Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between JDBC batch and transaction?  RSS feed

 
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
Sheriff
Posts: 36463
462
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!