collective / collective.taskqueue

Asyncore-based asynchronous task queue for Plone
https://pypi.org/project/collective.taskqueue
8 stars 7 forks source link

Fix problems with conflicting transactions. #10

Closed jone closed 9 years ago

jone commented 9 years ago

Only enqueue tasks when transaction is successfully finished.

When a transaction conflicts, the ISavepointDataManager's commit() method is called, followed by tpc_abort(). When the transaction is successful, commit() is called followed by tpc_finish().

Since we cannot roll back putting something in the queue we must enqueue the task in tpc_finish() and not in commit(). We assume that enqueueing a task does not fail.

datakurre commented 9 years ago

@jone That makes sense. Thanks.