Greetings,
I have a python script that I run continuously to update and insert records in a SQL Server Express database. This has been working properly for many months until this weekend. When I try running the script, I get a "RuntimeError: workspace already in transaction mode" error and won't execute any further.
I have tried various solutions from posts I have seen, but none have solved this problem. None of the feature classes are registered as versioned. I am running SQL Server 2008 R2.
I am a bit mystifed to know what has changed that would cause this problem. I appreciate any help! Thanks very much!
Regards,
Tom
Are the two cursors that update/insert features running at the same moment on the same workspace? If so, did that work before? Is the script running as a scheduled task and is it possible that there are two instances of the script running at the same time?
Or better yet: ArcGIS Help (10.2, 10.2.1, and 10.2.2)
Note:
Opening simultaneous insert or update operations on the same workspace using different cursors requires the start of an edit session.
So, use an edit session to avoid the problem
Xander,
Thanks again. I have never had to set these up as registered or use an edit session. They have been running without those for a really long time. That is why I am wondering what has changed about the environment that would create this problem.
I would really prefer not to register them and use an edit session.
Regards,
Tom
Xander,
Thanks very much for the quick response! The two cursors are running consecutively. The update occurs first followed by the insert.
This script has been running for over 3 years without any modificaton.
I actually have the script running as a service using the srvany.exe. This has also worked very well. Since it is not functioning, I stop the service and I run the script manually to see what is going on.
I have looked to see if multiple instance are running, but I only see one instance in the processes in my Task Manager.
Regards,
Tom
Interesting... Would it be a lot of work to adapt the script and see if using an edit session resolves the problem?
I could certainly copy my script and try it. I am wondering if the performance would slow down greatly by using an edit session.
The python script is listening on a UDP port for vehicle message and updating a vehicles feature class and inserting a record into a historical position feature class.
Without an edit session it takes about .02 seconds to process a vehicle position. I am assuming that a edit session might take a bit longer.
Regards,
Tom
mmm, I see your point... Not really sure how much the process would loose in performance when using an edit session. If you call your script very frequently, I can imagine that this will not be an option.
Xander,
It looks like I may have reached a finite limit of the geodatabase size. This may be causing my problem. I am removing some older position data and see if that is what is causing my problem.
Thanks very much!
Regards,
Tom
OK, great. Please post back in case that is the reason, so others can benefit from it.