Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding autoCommit()

 
Sajee Joseph
Ranch Hand
Posts: 200
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
In my servlet application, i have an setAutoCommit(false) statement. I use this to control the commits & rollbacks. is it necessary to set back the autoCommit to true after the commit or rollback is done?
Thanks,
Sajee
 
Jason Cox
Ranch Hand
Posts: 287
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what you are trying to do. If the connection is closed, then the next connection you open will likely have autoCommit set to 'true'. In which case you'll have to set it to false upon each opening of a new connection.
However, you should only need to set autoCommit back to true if the connection is still open and you're doing additional processing with it where you want it to autoCommit. Can't think of any examples personally since I pretty much set it to autoCommit false and leave it that way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic