Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Default Commit mode

 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read on Sun site http://java.sun.com/docs/books/tutorial/jdbc/basics/transactions.html that
"The default is for an SQL statement to be committed when it is completed, not when it is executed."
I didn't get the meaning out of it.
Can you help?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The full quote from that page is:
To be more precise, the default is for an SQL statement to be committed when it is completed, not when it is executed. A statement is completed when all of its result sets and update counts have been retrieved. In almost all cases, however, a statement is completed, and therefore committed, right after it is executed


This explains things a bit more. It shows that after a query is executed, there is some more housekeeping - the result needs to be returned to the user. Usually this doesn't take long - especially since we are dealing with update/insert/delete queries. Hence people think of commit and execute as the same thing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic