Multiprocess call to Intersect_analysis can't create output to gdb

Discussion created by spiskulaesriuk-esridist Employee on Oct 28, 2011
Latest reply on Oct 31, 2011 by bharold-esristaff

I have a script that calculates some intersections between two featureclasses. Since there is a lot of data to process I am trying to have it done in parallelbatches. The work is split into several concurrently running .py script processes . They all take the same input feature classes but operate on different features.  Because i need to store and persist the output of each such intersection, each result is saved in my .gdb database in a separate result featureclass. To maintain unique result names, they all have the same prefix with appended unique batch id. So when i execute 2 batches with id 1 and 2 it results in featureclasses named Result_1 and Result_2 .

The problem is that when the output of those simultaneously running processes is set to the same GDB database, for example "C:\data\workspace.gdb", only one process can create the desired output from arcpy.Intersect_analysis to "C:\data\workspace.gdb\Result_1" (that would be for case when process for batch with id =1 succeeds). All other processes fail with the message like:

 ExecuteError('ERROR 000210: Cannot create output C:\data\workspace.gdb\Result_2\nFailed to execute (Intersect).\n',)

Interestingly the problem does not occur if I change my output workspace type from GDB to MDB. Then it all goes well and each process can create it's proper output as I would expect within the same workspace without problems.

Are there any steps that I should take to resolve this issue? I am guessing that once a process gets a handle to GDB there mus exist some sort of index of existing featureclasses, and since it has exclusive access to it the other processes can't modify it. Therefore only one process at time can operate on the database. But that is only my guess.

Can anyone advice on that or confirm/reject my guesses?