One datasource, two db schemas, two nuxeo repositories

  • Nuxeo 5.8
  • Postgres 9.2

I need another repository besides the default one. Its role is to be an archive of old documents.

I have defined it as a contribution:

<repository name="documentArchive" factory="">
    <repository sendInvalidationEvents="true">
        <property name="ServerName"></property>
        <property name="PortNumber">5432</property>
        <property name="DatabaseName">nuxeo_archive</property>
        <property name="User">nuxeo</property>
        <property name="Password">nuxeo</property>

I have made the nuxeo_archive database to hold this.

What I acctualy wanted was to put this in a specific database schema in the same database as the default repository so they can share the connection. But I could not find a way to define it like this.
Is this possible?

I like the Single-Datasource Mode that comes as default for all connections and I would like to stick to it. Without this I need to fall back to XA transactions that I try to avoid.

Another aproach that I have been looking into is to use the single datasource mode with an exclusion on documentArchive and use compensation on failed transactions to documentArhive. In nuxeo.conf I have put:


but I get this exception when the default respository connection is beeing closed:

ERROR [http-bio-] [] (5) SQL: XA end error on org.apache.geronimo.transaction.manager.XidImpl@76c188fa


  • How should I define both repositories to use the same datasource but different database schemas so I can use non-XA datasources ?
  • Is it something wrong on how I try to use the “nuxeo.db.singleDataSource.exclude” option?
0 votes

1 answers



nuxeo.db.singleDataSource.exclude has not been much tested so it's not surprising if there are bugs.

I don't think it's possible to use the same datasource but different databases. Single-datasource mode is mainly designed to share the datasource between VCS and other JDBC accesses in Nuxeo, not for do multi-database.

For the repository definition we don't have a way to specify the schema to use sorry. That would be the solution for you but it's not implemented.

0 votes

In fact, if you try to use nuxeo.db.singleDataSource.exclude in nuxeo.conf, it throws

FreeMarker templates: nuxeo.db.singleDataSource is already defined - nuxeo.db.singleDataSource.exclude will not be available in the data model.