cancel
Showing results for 
Search instead for 
Did you mean: 

Error while configuring multiple repositories

Ravindra_Nalavd
Champ on-the-rise
Champ on-the-rise

I want to create second repository in Nuxeo Multiple Repositories Configuration as given in the documentation, I have updated nuxeo.conf file also updated datasources-secondrepo-config.xml and `repository-secondrepo-config.xml.

Following are the configurations files that I have added manually in $NUXEO_HOME/nxserver/config directory

  • datasources-secondrepo-config.xml
	<?xml version="1.0"?>
	<component name="datasources-secondrepo-config">
	
	  <extension target="org.nuxeo.runtime.datasource" point="datasources">
	    <datasource name="jdbc/repository_secondrepo" xaDataSource="org.postgresql.xa.PGXADataSource"
	      maxPoolSize="100" minPoolSize="5" blockingTimeoutMillis="10000">
	        <property name="ServerName">10.43.11.77</property>
	        <property name="PortNumber">5432</property>
	        <property name="DatabaseName">secondrepo</property>
	        <property name="User">postgres</property>
	        <property name="Password">admin</property>
	    </datasource>
	  </extension>
	  
	  <link name="jdbc/secondrepo_keyvaluestore" global="jdbc/repository_secondrepo" type="javax.sql.DataSource" />
	</component>

repository configuration in

  • repository-secondrepo-config.xml
<?xml version="1.0"?>
<component name="repository-secondrepo-config">
  <extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration">
    <blobprovider name="secondrepo">
      <class>org.nuxeo.ecm.core.blob.binary.DefaultBinaryManager</class>
      <property name="path">binaries2</property>
	  <property name="key"></property>
    </blobprovider>
  </extension>

  <extension target="org.nuxeo.ecm.core.storage.sql.RepositoryService"
    point="repository">
    <repository name="secondrepo" label="label.second.repository" factory="org.nuxeo.ecm.core.storage.sql.ra.PoolingRepositoryFactory">
      <pool minPoolSize="0" maxPoolSize="20"
        blockingTimeoutMillis="100"
        idleTimeoutMinutes="10"
        activeTimeoutMinutes="0" />
      <clustering enabled="false" delay="1000" />
      <clusterInvalidatorClass>org.nuxeo.ecm.core.storage.sql.VCSPubSubInvalidator</clusterInvalidatorClass>
      <noDDL>false</noDDL>
      <ddlMode>execute</ddlMode>
      <aclOptimizations enabled="true"/>
      <pathOptimizations enabled="true"/>
      <idType>varchar</idType>
      <changeTokenEnabled>true</changeTokenEnabled>
      <indexing>
        <fulltext disabled="false" searchDisabled="false"
                  analyzer="english">
          <index name="secondrepo">
            <!-- all props implied -->
          </index>
          <index name="title">
            <field>dc:title</field>
          </index>
          <index name="description">
            <field>dc:description</field>
          </index>
        </fulltext>
      </indexing>
      <usersSeparator key="," />
    </repository>
  </extension>
  
  <extension target="org.nuxeo.runtime.kv.KeyValueService" point="configuration">
    <store name="secondrepo" class="org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore">
      <property name="datasource">jdbc/secondrepo_keyvaluestore</property>
      <property name="table">kv</property>
    </store>
  </extension>

</component>

In PostgreSQL DB I have added the following properties

max_prepared_transactions = 100

When I start Nuxeo server, I am getting following error logs, although second repository is working fine, All CRUD operations are also working as expected. Am I missing some property or configuration?

2019-10-11T09:40:08,789 ERROR [RetryTimer] [org.apache.geronimo.transaction.manager.RollbackTask] Unexpected exception committing org.apache.geronimo.transaction.manager.WrapperNamedXAResource@56a0dd11; continuing to commit other RMs
org.postgresql.xa.PGXAException: Error rolling back prepared transaction. rollback xid=[Xid:globalId=11000000047544d4944000000000000000000000000000000000000000000000000000,length=64,branchId=1000000047544d4944000000000000000000000000000000000000000000000000000,length=64], preparedXid=[Xid:globalId=11000000047544d4944000000000000000000000000000000000000000000000000000,length=64,branchId=1000000047544d4944000000000000000000000000000000000000000000000000000,length=64], currentXid={2}
        at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:480) ~[postgresql-42.2.5.jar:42.2.5]
        at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.rollback(WrapperNamedXAResource.java:100) ~[geronimo-transaction-2.2.1.jar:2.2.1]
        at org.apache.geronimo.transaction.manager.RollbackTask.run(RollbackTask.java:63) [geronimo-transaction-2.2.1.jar:2.2.1]
        at org.apache.geronimo.transaction.manager.ExponentialtIntervalRetryScheduler$TaskWrapper.run(ExponentialtIntervalRetryScheduler.java:50) [geronimo-transaction-2.2.1.jar:2.2.1]
        at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_222]
        at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_222]
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
        at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:783) ~[postgresql-42.2.5.jar:42.2.5]
        at org.postgresql.jdbc.PgConnection.setAutoCommit(PgConnection.java:727) ~[postgresql-42.2.5.jar:42.2.5]
        at org.postgresql.xa.PGXAConnection.rollback(PGXAConnection.java:454) ~[postgresql-42.2.5.jar:42.2.5]
        ... 5 more
1 ACCEPTED ANSWER

Patrick_Abgrall
Star Contributor
Star Contributor

If you have a setup meeting https://doc.nuxeo.com/nxdoc/jdbc-datasource/#accessing-multiple-databases in addition to https://doc.nuxeo.com/nxdoc/postgresql/#two-phase-commit , then you might have hit an unwanted situation, either from Nuxeo or PG or Apache. If the documentations links above do not help, try opening a Jira ticket?

View answer in original post

2 REPLIES 2

Patrick_Abgrall
Star Contributor
Star Contributor

If you have a setup meeting https://doc.nuxeo.com/nxdoc/jdbc-datasource/#accessing-multiple-databases in addition to https://doc.nuxeo.com/nxdoc/postgresql/#two-phase-commit , then you might have hit an unwanted situation, either from Nuxeo or PG or Apache. If the documentations links above do not help, try opening a Jira ticket?

Thanks [Patrick Abgrall](https

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.