<?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: Concurrent node children insert problem in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/concurrent-node-children-insert-problem/m-p/115535#M32057</link>
    <description>&lt;P&gt;I solved the problem by synchronizing insert calls. See code below:&lt;/P&gt;&lt;PRE&gt;private static Object lockingObjectInsert = new Object();&lt;BR /&gt;	
private Response&amp;lt;NodeRepresentation&amp;gt; insertSynchronized(Document documentEntity,NodeBodyCreate documentBody) throws IOException {
    synchronized (lockingObjectInsert) {
	Response&amp;lt;NodeRepresentation&amp;gt; responseCreate = getNodesAPI().createNodeCall(getFolderId(documentEntity), documentBody,true,null,null).execute();
	return responseCreate;
    }
}&lt;/PRE&gt;</description>
    <pubDate>Sat, 23 May 2020 12:27:09 GMT</pubDate>
    <dc:creator>mire323</dc:creator>
    <dc:date>2020-05-23T12:27:09Z</dc:date>
    <item>
      <title>Concurrent node children insert problem</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/concurrent-node-children-insert-problem/m-p/115534#M32056</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;first of all thanks for reading my question!&lt;/P&gt;&lt;P&gt;I have a problem with concurrent insertion of documents using nodes api:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="path"&gt;&lt;A href="https://api-explorer.alfresco.com/api-explorer/#!/nodes/createNode" target="_blank" rel="noopener nofollow noreferrer"&gt;/nodes/{nodeId}/children?autoRename=true&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="path"&gt;It returns 409 when i try inserting 5 documents with the same name concurrently.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="path"&gt;Can you please help me avoid 409 error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="path"&gt;Thanks for reading, I would apreciate any idea that leads to solution.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 13:32:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/concurrent-node-children-insert-problem/m-p/115534#M32056</guid>
      <dc:creator>mire323</dc:creator>
      <dc:date>2020-05-22T13:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrent node children insert problem</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/concurrent-node-children-insert-problem/m-p/115535#M32057</link>
      <description>&lt;P&gt;I solved the problem by synchronizing insert calls. See code below:&lt;/P&gt;&lt;PRE&gt;private static Object lockingObjectInsert = new Object();&lt;BR /&gt;	
private Response&amp;lt;NodeRepresentation&amp;gt; insertSynchronized(Document documentEntity,NodeBodyCreate documentBody) throws IOException {
    synchronized (lockingObjectInsert) {
	Response&amp;lt;NodeRepresentation&amp;gt; responseCreate = getNodesAPI().createNodeCall(getFolderId(documentEntity), documentBody,true,null,null).execute();
	return responseCreate;
    }
}&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 May 2020 12:27:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/concurrent-node-children-insert-problem/m-p/115535#M32057</guid>
      <dc:creator>mire323</dc:creator>
      <dc:date>2020-05-23T12:27:09Z</dc:date>
    </item>
  </channel>
</rss>

