<?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 Re: One datasource, two db schemas, two nuxeo repositories in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/one-datasource-two-db-schemas-two-nuxeo-repositories/m-p/314506#M1507</link>
    <description>&lt;P&gt;In fact, if you try to use nuxeo.db.singleDataSource.exclude in nuxeo.conf, it throws&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2015 16:27:34 GMT</pubDate>
    <dc:creator>pibou_Bouvret</dc:creator>
    <dc:date>2015-04-20T16:27:34Z</dc:date>
    <item>
      <title>One datasource, two db schemas, two nuxeo repositories</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/one-datasource-two-db-schemas-two-nuxeo-repositories/m-p/314504#M1505</link>
      <description>&lt;UL&gt;
&lt;LI&gt;Nuxeo 5.8&lt;/LI&gt;
&lt;LI&gt;Postgres 9.2&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I need another repository besides the default one.
Its role is to be an archive of old documents.&lt;/P&gt;
&lt;P&gt;I have defined it as a contribution:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;repository name="documentArchive" factory="org.nuxeo.ecm.core.storage.sql.ra.PoolingRepositoryFactory"&amp;gt;
	&amp;lt;repository sendInvalidationEvents="true"&amp;gt;
		&amp;lt;xa-datasource&amp;gt;org.postgresql.xa.PGXADataSource&amp;lt;/xa-datasource&amp;gt;
		&amp;lt;property name="ServerName"&amp;gt;127.0.0.1&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;nuxeo_archive&amp;lt;/property&amp;gt;
		&amp;lt;property name="User"&amp;gt;nuxeo&amp;lt;/property&amp;gt;
		&amp;lt;property name="Password"&amp;gt;nuxeo&amp;lt;/property&amp;gt;
	&amp;lt;/repository&amp;gt;
&amp;lt;/repository&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have made the nuxeo_archive database to hold this.&lt;/P&gt;
&lt;P&gt;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.&lt;BR /&gt; /&amp;gt;
Is this possible?&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;nuxeo.db.singleDataSource.exclude=repository_documentArchive
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but I get this exception when the default respository connection is beeing closed:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;ERROR [http-bio-0.0.0.0-8080-exec-5] [org.nuxeo.ecm.core.storage.sql.jdbc.JDBCLogger] (5) SQL: XA end error on org.apache.geronimo.transaction.manager.XidImpl@76c188fa
java.lang.NullPointerException
	at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapper.end(JDBCMapper.java:1317)
	at org.nuxeo.ecm.core.storage.sql.SoftRefCachingMapper.end(SoftRefCachingMapper.java:182)
	at org.nuxeo.ecm.core.storage.sql.SessionImpl.end(SessionImpl.java:1430)
	at org.nuxeo.ecm.core.storage.sql.ra.ConnectionAwareXAResource.end(ConnectionAwareXAResource.java:59)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Questions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;How should I define both repositories to use the same datasource but different database schemas so I can use non-XA datasources ?&lt;/LI&gt;
&lt;LI&gt;Is it something wrong on how I try to use the "nuxeo.db.singleDataSource.exclude" option?&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 21 Feb 2014 14:37:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/one-datasource-two-db-schemas-two-nuxeo-repositories/m-p/314504#M1505</guid>
      <dc:creator>crisev_</dc:creator>
      <dc:date>2014-02-21T14:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: One datasource, two db schemas, two nuxeo repositories</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/one-datasource-two-db-schemas-two-nuxeo-repositories/m-p/314505#M1506</link>
      <description>&lt;P&gt;&lt;CODE&gt;nuxeo.db.singleDataSource.exclude&lt;/CODE&gt; has not been much tested so it's not surprising if there are bugs.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2014 13:10:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/one-datasource-two-db-schemas-two-nuxeo-repositories/m-p/314505#M1506</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2014-03-18T13:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: One datasource, two db schemas, two nuxeo repositories</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/one-datasource-two-db-schemas-two-nuxeo-repositories/m-p/314506#M1507</link>
      <description>&lt;P&gt;In fact, if you try to use nuxeo.db.singleDataSource.exclude in nuxeo.conf, it throws&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 16:27:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/one-datasource-two-db-schemas-two-nuxeo-repositories/m-p/314506#M1507</guid>
      <dc:creator>pibou_Bouvret</dc:creator>
      <dc:date>2015-04-20T16:27:34Z</dc:date>
    </item>
  </channel>
</rss>

