<?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 Cluster &amp;amp; CoreSession.setLock(…) [5.6] in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/cluster-amp-coresession-setlock-5-6/m-p/328023#M15024</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have two back-end servers on a single nuxeo-5.6 repository with concurrent scheduled import jobs running.
To avoid concurrent document creation, I use a try {} catch {} block and set a document lock on a common parent document :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-java"&gt;try {
 /* … */
 session.setLock(parentDocument.getRef());
 /* … */
 /* do multiple documents creation */
} finally {
 session.removeLock(parentDocument.getRef());
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It did worked fine… until today, two concurrent document creation occurred.&lt;/P&gt;
&lt;P&gt;So is &lt;CODE&gt;CoreSession#setLock(DocumentRef ref)&lt;/CODE&gt; a good way of handling mutual exclusion between servers ?
Is there a &lt;EM&gt;good&lt;/EM&gt; (or more atomic) way of writing cluster-safe process ?&lt;/P&gt;
&lt;P&gt;Cheers,
Léa Raya DÉCORNOD&lt;/P&gt;</description>
    <pubDate>Tue, 23 Feb 2016 10:00:47 GMT</pubDate>
    <dc:creator>Léa_____DÉCORNO</dc:creator>
    <dc:date>2016-02-23T10:00:47Z</dc:date>
    <item>
      <title>Cluster &amp; CoreSession.setLock(…) [5.6]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/cluster-amp-coresession-setlock-5-6/m-p/328023#M15024</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have two back-end servers on a single nuxeo-5.6 repository with concurrent scheduled import jobs running.
To avoid concurrent document creation, I use a try {} catch {} block and set a document lock on a common parent document :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="language-java"&gt;try {
 /* … */
 session.setLock(parentDocument.getRef());
 /* … */
 /* do multiple documents creation */
} finally {
 session.removeLock(parentDocument.getRef());
}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It did worked fine… until today, two concurrent document creation occurred.&lt;/P&gt;
&lt;P&gt;So is &lt;CODE&gt;CoreSession#setLock(DocumentRef ref)&lt;/CODE&gt; a good way of handling mutual exclusion between servers ?
Is there a &lt;EM&gt;good&lt;/EM&gt; (or more atomic) way of writing cluster-safe process ?&lt;/P&gt;
&lt;P&gt;Cheers,
Léa Raya DÉCORNOD&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 10:00:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/cluster-amp-coresession-setlock-5-6/m-p/328023#M15024</guid>
      <dc:creator>Léa_____DÉCORNO</dc:creator>
      <dc:date>2016-02-23T10:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster &amp; CoreSession.setLock(…) [5.6]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/cluster-amp-coresession-setlock-5-6/m-p/328024#M15025</link>
      <description>&lt;P&gt;The forthcoming Nuxeo State Manager, described in NXP-14553, will likely provide the ultimate solution to the issue you described. If you can't wait, you might consider adding a uniqueness constraint on specific columns in the hierarchy table as described in NXP-16912 and then writing some fairly low-level Java code to enforce unique pathSegments for children within a single Folderish document.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 05:03:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/cluster-amp-coresession-setlock-5-6/m-p/328024#M15025</guid>
      <dc:creator>rg1_</dc:creator>
      <dc:date>2016-02-25T05:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cluster &amp; CoreSession.setLock(…) [5.6]</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/cluster-amp-coresession-setlock-5-6/m-p/328025#M15026</link>
      <description>&lt;P&gt;This should work but 5.6 is a quite old Nuxeo version so we can't rule out locking bugs at this stage. Without a reproducible test case there's little hope to get to the bottom of this.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:16:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/cluster-amp-coresession-setlock-5-6/m-p/328025#M15026</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2016-03-31T14:16:25Z</dc:date>
    </item>
  </channel>
</rss>

