Transactional collision for sequential insertion in Google App Engine. What for?

I am inserting a recordset into the Google App Engine. I insert them into the package to exclude timeline exceptions.

When there are a large number of entries (e.g. 1k), I always get the unexpected:

Transaction collision for a group of objects with a key

datastore_types.Key.from_path (u'GroupModel ", u'root ', _app = u'streamtomail'). Repeated ...

This situation is always.

In a local environment, it works without any problems instead.

How is it possible to have transactional collisions if I use a sequential process and so far no one is using the system?

Here is the code I use for batch processing:

def deferred_worker(): if next_chunk(): process_chunk() deferred.defer(deferred_worker) 

where in * process_chunk () * I make 50 attachments in the database

+4
source share
1 answer

The collision is on an instance of your GroupModel with the key name "root". Based on this, I assume that you put everything in one entity group along with the parent. As described here , each object with the same parent is in the same entity group to which the transactions are broadcast. Thus, any concurrent updates for any object in this group potentially conflict with any other.

+2
source

All Articles