Hi Mike, I'm not aware of a design issue that could prevent to use cmislib python into multi threads. The problem you describe is a normal behaviour when two actors (human or prog) update the same resource at same time into alfresco.
Regards, lmignon On Fri, May 25, 2018 at 12:19 PM, Mike IT Expert <mikeitexp...@gmail.com> wrote: > Dear All, > > Apologies in advance for sending this message to dev mailing list (I wish > there was userlist also I wasn't sure it is bug or not.) > > I have started working with cmislib since past week using Alfresco as the > local server. > > My goal is to upload documents provided by json rcord list in a for loop > as you see below *which is part of run-overiden method of > threading.Thread.run method for python 2.7*. > > The main code is attached just in case. > > > > The above code works find using ONE thread only. If I use more than one > thread I get the below exception for some records which is odd. > > > File "module_proj_2_parts_1_and_2.py", line 82, in run > newDoc = targetFolder.createDocument( docName, contentFile = inFile ) > File "/home/mike/Desktop/hassan_proj2/.pyenv2/local/lib/ > python2.7/site-packages/cmislib/atompub/binding.py", line 2788, in > createDocument > contentEncoding) > File "/home/mike/Desktop/hassan_proj2/.pyenv2/local/lib/ > python2.7/site-packages/cmislib/atompub/binding.py", line 1807, in > createDocument > ATOM_XML_ENTRY_TYPE) > File "/home/mike/Desktop/hassan_proj2/.pyenv2/local/lib/ > python2.7/site-packages/cmislib/atompub/binding.py", line 188, in post > self._processCommonErrors(resp, url) > File "/home/mike/Desktop/hassan_proj2/.pyenv2/local/lib/ > python2.7/site-packages/cmislib/cmis_services.py", line 63, in > _processCommonErrors > raise UpdateConflictException(error[\'status\'], > url)\nUpdateConflictException: Error 409 at http://127.0.0.1:8080/ > alfresco/api/-default-/public/cmis/versions/1.1/atom/ > children?id=4baddda1-87eb-45eb-8d0b-9958b8942c4f\n > > > I doubt if it is bug ... but if it is please let me know where I can start > to fix this. > > Also, my pip freeze package versions are as below: > > certifi==2018.4.16 > chardet==3.0.4 > cmislib==0.6.0 > httplib2==0.11.3 > idna==2.6 > iso8601==0.1.12 > requests==2.18.4 > urllib3==1.22 > > I appreciate any clue/comment. > > Best Regards, > Mike > > > > > -- *Laurent Mignon* Senior software engineer Tel: +352 20 21 10 20 32 Fax: +352 20 21 10 21 Email: laurent.mig...@acsone.eu Acsone SA, Succursale de Luxembourg 22, Zone Industrielle | L-8287 Kehlen, Luxembourg TVA LU24733605 | RCS B160400 Acsone sa/nv Waterloo Atrium, Drève Richelle 167 | B-1410 Waterloo RPM Bruxelles 0835.207.216 RPR Brussel www.acsone.eu