Re: [Perl-workflow-devel] AutoCommit in workflow
Brought to you by:
jonasbn
From: Jim B. <cb...@bu...> - 2008-04-07 19:39:18
|
Jonas Brømsø Nielsen wrote: > > Hmmm this might be the actual challenge, from my standpoint; the > workflow engine should keep it own state and transactions. But getting > this to balance with transactions in applications utilizing Workflow, > might be a question of discipline and can prove - difficult. > As far as how it 'should' work, I think the workflow app should commit when a single unit of work (a transaction, which may be multiple executes against the DB) is complete. This can be challenging since you need to then define what this means to workflow. In practice, it might not be too bad. I looked at the code a bit and all the inserts and updates are in the Persister/DBI module and most actions require just a few inserts updates. It might get tricky with an update to the main workflow table, an update to an optional extra_data table, and the insert of a few history items. It gets trickier when you think about a passed in DB handle. Without autocommit, the outside app might leave transactions pending. But I think this has to be the user's problem. We could insert a warning, or perhaps commit before we do anything. It would then be workflow's job to make sure there were no exit points where you could return the handle with a pending transaction. I'd be interested in trying out some options. Should I create a separate branch? Jim -- Jim Brandt Administrative Computing Services University at Buffalo |