Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between JDBC batch and transaction?

 
Carissa Lew
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone explains to me what are the differences between batch and transactions.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34097
337
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A transaction is when the database commits the updates - like a point of no return. A batch is a bunch of statements that gets sent to the database at the same time. A transaction can have multiple batches in it. The batch is just a concept to save database round trips and make the code faster.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic