• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

When commit transaction

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 93
IntelliJ IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Forget Steve. Look at this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic