• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When use Batch update,would i must setAutoCommit(false)??

 
alex han
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have code like this
 
Ram Mohan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the whole idea of a Batch Update is to write to the database as little as possible. Only when auto commit is set off, will the data be committed only at the end of the transaction. That way the entire transaction can take place or fail. Though not a rule, i guess it's better to follow this convention
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question - let me clarify -
"Are JDBC batch executes automatically wrapped in a transaction?"
My guess is no. I would put the auto-commit statements in there. Can't hurt!
 
alex han
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic