| Author |
When commit transaction
|
Samy Ganou
Greenhorn
Joined: Oct 05, 2009
Posts: 27
|
|
I have a table containing records with a status = not_processed.
I have to do a job that take each record and try to call a workflow to get a value , update this record with the value and set status=Processed.
The processing of a record is independant of the other records .
So i will have to use one transaction for all records and commit it at the end of program or , a new transaction for each record and commit just after the update of the record ?
Thank you.
|
 |
Hadi Zeftin
Greenhorn
Joined: Jun 03, 2010
Posts: 8
|
|
so you tryin to create a batch job that take each record, do some processing, and update the records ?
I don't see why you need a transaction for this kind of requirement?
|
 |
Eduardo YaƱez Parareda
Ranch Hand
Joined: Oct 09, 2008
Posts: 92
|
|
Samy Ganou wrote:I have a table containing records with a status = not_processed.
I have to do a job that take each record and try to call a workflow to get a value , update this record with the value and set status=Processed.
The processing of a record is independant of the other records .
So i will have to use one transaction for all records and commit it at the end of program or , a new transaction for each record and commit just after the update of the record ?
Thank you.
If you use only one transaction and commit it at the end, records' updates will be dependent, if one of them fails the rollback will put them all in their previous states.
So you need a transaction for each register.
|
http://serfj.sourceforge.net - Simplest Ever REST Framework for Java
|
 |
 |
|
|
subject: When commit transaction
|
|
|