<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error while configuring multiple repositories in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/error-while-configuring-multiple-repositories/m-p/328175#M15176</link>
    <description>&lt;P&gt;I want to create second repository in Nuxeo &lt;A href="https://doc.nuxeo.com/nxdoc/multiple-repositories-configuration/"&gt;Multiple Repositories Configuration&lt;/A&gt;
as given in the documentation, I have updated &lt;CODE&gt;nuxeo.conf&lt;/CODE&gt; file also updated &lt;CODE&gt;datasources-secondrepo-config.xml&lt;/CODE&gt;
and `repository-secondrepo-config.xml.&lt;/P&gt;
&lt;P&gt;Following are the configurations files that I have added manually in &lt;CODE&gt;$NUXEO_HOME/nxserver/config&lt;/CODE&gt; directory&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;datasources-secondrepo-config.xml&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&lt;CODE class="language-xml"&gt;	&amp;lt;?xml version="1.0"?&amp;gt;
	&amp;lt;component name="datasources-secondrepo-config"&amp;gt;
	
	  &amp;lt;extension target="org.nuxeo.runtime.datasource" point="datasources"&amp;gt;
	    &amp;lt;datasource name="jdbc/repository_secondrepo" xaDataSource="org.postgresql.xa.PGXADataSource"
	      maxPoolSize="100" minPoolSize="5" blockingTimeoutMillis="10000"&amp;gt;
	        &amp;lt;property name="ServerName"&amp;gt;10.43.11.77&amp;lt;/property&amp;gt;
	        &amp;lt;property name="PortNumber"&amp;gt;5432&amp;lt;/property&amp;gt;
	        &amp;lt;property name="DatabaseName"&amp;gt;secondrepo&amp;lt;/property&amp;gt;
	        &amp;lt;property name="User"&amp;gt;postgres&amp;lt;/property&amp;gt;
	        &amp;lt;property name="Password"&amp;gt;admin&amp;lt;/property&amp;gt;
	    &amp;lt;/datasource&amp;gt;
	  &amp;lt;/extension&amp;gt;
	  
	  &amp;lt;link name="jdbc/secondrepo_keyvaluestore" global="jdbc/repository_secondrepo" type="javax.sql.DataSource" /&amp;gt;
	&amp;lt;/component&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;repository configuration in&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;repository-secondrepo-config.xml&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&lt;CODE class="language-xml"&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="repository-secondrepo-config"&amp;gt;
  &amp;lt;extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration"&amp;gt;
    &amp;lt;blobprovider name="secondrepo"&amp;gt;
      &amp;lt;class&amp;gt;org.nuxeo.ecm.core.blob.binary.DefaultBinaryManager&amp;lt;/class&amp;gt;
      &amp;lt;property name="path"&amp;gt;binaries2&amp;lt;/property&amp;gt;
	  &amp;lt;property name="key"&amp;gt;&amp;lt;/property&amp;gt;
    &amp;lt;/blobprovider&amp;gt;
  &amp;lt;/extension&amp;gt;

  &amp;lt;extension target="org.nuxeo.ecm.core.storage.sql.RepositoryService"
    point="repository"&amp;gt;
    &amp;lt;repository name="secondrepo" label="label.second.repository" factory="org.nuxeo.ecm.core.storage.sql.ra.PoolingRepositoryFactory"&amp;gt;
      &amp;lt;pool minPoolSize="0" maxPoolSize="20"
        blockingTimeoutMillis="100"
        idleTimeoutMinutes="10"
        activeTimeoutMinutes="0" /&amp;gt;
      &amp;lt;clustering enabled="false" delay="1000" /&amp;gt;
      &amp;lt;clusterInvalidatorClass&amp;gt;org.nuxeo.ecm.core.storage.sql.VCSPubSubInvalidator&amp;lt;/clusterInvalidatorClass&amp;gt;
      &amp;lt;noDDL&amp;gt;false&amp;lt;/noDDL&amp;gt;
      &amp;lt;ddlMode&amp;gt;execute&amp;lt;/ddlMode&amp;gt;
      &amp;lt;aclOptimizations enabled="true"/&amp;gt;
      &amp;lt;pathOptimizations enabled="true"/&amp;gt;
      &amp;lt;idType&amp;gt;varchar&amp;lt;/idType&amp;gt;
      &amp;lt;changeTokenEnabled&amp;gt;true&amp;lt;/changeTokenEnabled&amp;gt;
      &amp;lt;indexing&amp;gt;
        &amp;lt;fulltext disabled="false" searchDisabled="false"
                  analyzer="english"&amp;gt;
          &amp;lt;index name="secondrepo"&amp;gt;
            &amp;lt;!-- all props implied --&amp;gt;
          &amp;lt;/index&amp;gt;
          &amp;lt;index name="title"&amp;gt;
            &amp;lt;field&amp;gt;dc:title&amp;lt;/field&amp;gt;
          &amp;lt;/index&amp;gt;
          &amp;lt;index name="description"&amp;gt;
            &amp;lt;field&amp;gt;dc:description&amp;lt;/field&amp;gt;
          &amp;lt;/index&amp;gt;
        &amp;lt;/fulltext&amp;gt;
      &amp;lt;/indexing&amp;gt;
      &amp;lt;usersSeparator key="," /&amp;gt;
    &amp;lt;/repository&amp;gt;
  &amp;lt;/extension&amp;gt;
  
  &amp;lt;extension target="org.nuxeo.runtime.kv.KeyValueService" point="configuration"&amp;gt;
    &amp;lt;store name="secondrepo" class="org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore"&amp;gt;
      &amp;lt;property name="datasource"&amp;gt;jdbc/secondrepo_keyvaluestore&amp;lt;/property&amp;gt;
      &amp;lt;property name="table"&amp;gt;kv&amp;lt;/property&amp;gt;
    &amp;lt;/store&amp;gt;
  &amp;lt;/extension&amp;gt;

&amp;lt;/component&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In PostgreSQL DB I have added the following properties&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;max_prepared_transactions = 100
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;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
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 Oct 2019 14:10:15 GMT</pubDate>
    <dc:creator>Ravindra_Nalavd</dc:creator>
    <dc:date>2019-10-11T14:10:15Z</dc:date>
    <item>
      <title>Error while configuring multiple repositories</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/error-while-configuring-multiple-repositories/m-p/328175#M15176</link>
      <description>&lt;P&gt;I want to create second repository in Nuxeo &lt;A href="https://doc.nuxeo.com/nxdoc/multiple-repositories-configuration/"&gt;Multiple Repositories Configuration&lt;/A&gt;
as given in the documentation, I have updated &lt;CODE&gt;nuxeo.conf&lt;/CODE&gt; file also updated &lt;CODE&gt;datasources-secondrepo-config.xml&lt;/CODE&gt;
and `repository-secondrepo-config.xml.&lt;/P&gt;
&lt;P&gt;Following are the configurations files that I have added manually in &lt;CODE&gt;$NUXEO_HOME/nxserver/config&lt;/CODE&gt; directory&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;datasources-secondrepo-config.xml&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&lt;CODE class="language-xml"&gt;	&amp;lt;?xml version="1.0"?&amp;gt;
	&amp;lt;component name="datasources-secondrepo-config"&amp;gt;
	
	  &amp;lt;extension target="org.nuxeo.runtime.datasource" point="datasources"&amp;gt;
	    &amp;lt;datasource name="jdbc/repository_secondrepo" xaDataSource="org.postgresql.xa.PGXADataSource"
	      maxPoolSize="100" minPoolSize="5" blockingTimeoutMillis="10000"&amp;gt;
	        &amp;lt;property name="ServerName"&amp;gt;10.43.11.77&amp;lt;/property&amp;gt;
	        &amp;lt;property name="PortNumber"&amp;gt;5432&amp;lt;/property&amp;gt;
	        &amp;lt;property name="DatabaseName"&amp;gt;secondrepo&amp;lt;/property&amp;gt;
	        &amp;lt;property name="User"&amp;gt;postgres&amp;lt;/property&amp;gt;
	        &amp;lt;property name="Password"&amp;gt;admin&amp;lt;/property&amp;gt;
	    &amp;lt;/datasource&amp;gt;
	  &amp;lt;/extension&amp;gt;
	  
	  &amp;lt;link name="jdbc/secondrepo_keyvaluestore" global="jdbc/repository_secondrepo" type="javax.sql.DataSource" /&amp;gt;
	&amp;lt;/component&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;repository configuration in&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;repository-secondrepo-config.xml&lt;/CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&lt;CODE class="language-xml"&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="repository-secondrepo-config"&amp;gt;
  &amp;lt;extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration"&amp;gt;
    &amp;lt;blobprovider name="secondrepo"&amp;gt;
      &amp;lt;class&amp;gt;org.nuxeo.ecm.core.blob.binary.DefaultBinaryManager&amp;lt;/class&amp;gt;
      &amp;lt;property name="path"&amp;gt;binaries2&amp;lt;/property&amp;gt;
	  &amp;lt;property name="key"&amp;gt;&amp;lt;/property&amp;gt;
    &amp;lt;/blobprovider&amp;gt;
  &amp;lt;/extension&amp;gt;

  &amp;lt;extension target="org.nuxeo.ecm.core.storage.sql.RepositoryService"
    point="repository"&amp;gt;
    &amp;lt;repository name="secondrepo" label="label.second.repository" factory="org.nuxeo.ecm.core.storage.sql.ra.PoolingRepositoryFactory"&amp;gt;
      &amp;lt;pool minPoolSize="0" maxPoolSize="20"
        blockingTimeoutMillis="100"
        idleTimeoutMinutes="10"
        activeTimeoutMinutes="0" /&amp;gt;
      &amp;lt;clustering enabled="false" delay="1000" /&amp;gt;
      &amp;lt;clusterInvalidatorClass&amp;gt;org.nuxeo.ecm.core.storage.sql.VCSPubSubInvalidator&amp;lt;/clusterInvalidatorClass&amp;gt;
      &amp;lt;noDDL&amp;gt;false&amp;lt;/noDDL&amp;gt;
      &amp;lt;ddlMode&amp;gt;execute&amp;lt;/ddlMode&amp;gt;
      &amp;lt;aclOptimizations enabled="true"/&amp;gt;
      &amp;lt;pathOptimizations enabled="true"/&amp;gt;
      &amp;lt;idType&amp;gt;varchar&amp;lt;/idType&amp;gt;
      &amp;lt;changeTokenEnabled&amp;gt;true&amp;lt;/changeTokenEnabled&amp;gt;
      &amp;lt;indexing&amp;gt;
        &amp;lt;fulltext disabled="false" searchDisabled="false"
                  analyzer="english"&amp;gt;
          &amp;lt;index name="secondrepo"&amp;gt;
            &amp;lt;!-- all props implied --&amp;gt;
          &amp;lt;/index&amp;gt;
          &amp;lt;index name="title"&amp;gt;
            &amp;lt;field&amp;gt;dc:title&amp;lt;/field&amp;gt;
          &amp;lt;/index&amp;gt;
          &amp;lt;index name="description"&amp;gt;
            &amp;lt;field&amp;gt;dc:description&amp;lt;/field&amp;gt;
          &amp;lt;/index&amp;gt;
        &amp;lt;/fulltext&amp;gt;
      &amp;lt;/indexing&amp;gt;
      &amp;lt;usersSeparator key="," /&amp;gt;
    &amp;lt;/repository&amp;gt;
  &amp;lt;/extension&amp;gt;
  
  &amp;lt;extension target="org.nuxeo.runtime.kv.KeyValueService" point="configuration"&amp;gt;
    &amp;lt;store name="secondrepo" class="org.nuxeo.ecm.core.storage.sql.kv.SQLKeyValueStore"&amp;gt;
      &amp;lt;property name="datasource"&amp;gt;jdbc/secondrepo_keyvaluestore&amp;lt;/property&amp;gt;
      &amp;lt;property name="table"&amp;gt;kv&amp;lt;/property&amp;gt;
    &amp;lt;/store&amp;gt;
  &amp;lt;/extension&amp;gt;

&amp;lt;/component&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In PostgreSQL DB I have added the following properties&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;max_prepared_transactions = 100
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;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?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;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
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Oct 2019 14:10:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/error-while-configuring-multiple-repositories/m-p/328175#M15176</guid>
      <dc:creator>Ravindra_Nalavd</dc:creator>
      <dc:date>2019-10-11T14:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error while configuring multiple repositories</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/error-while-configuring-multiple-repositories/m-p/328176#M15177</link>
      <description>&lt;P&gt;If you have a setup meeting &lt;A href="https://doc.nuxeo.com/nxdoc/jdbc-datasource/#accessing-multiple-databases" target="test_blank"&gt;https://doc.nuxeo.com/nxdoc/jdbc-datasource/#accessing-multiple-databases&lt;/A&gt; in addition to &lt;A href="https://doc.nuxeo.com/nxdoc/postgresql/#two-phase-commit" target="test_blank"&gt;https://doc.nuxeo.com/nxdoc/postgresql/#two-phase-commit&lt;/A&gt; , 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?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:53:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/error-while-configuring-multiple-repositories/m-p/328176#M15177</guid>
      <dc:creator>Patrick_Abgrall</dc:creator>
      <dc:date>2019-10-16T11:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error while configuring multiple repositories</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/error-while-configuring-multiple-repositories/m-p/328177#M15178</link>
      <description>&lt;P&gt;Thanks [Patrick Abgrall](https&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 17:12:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/error-while-configuring-multiple-repositories/m-p/328177#M15178</guid>
      <dc:creator>Ravindra_Nalavd</dc:creator>
      <dc:date>2019-10-22T17:12:04Z</dc:date>
    </item>
  </channel>
</rss>

