• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When commit transaction

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic