wood burning stoves 2.0*
The moose likes JDBC and the fly likes When use Batch update,would i must setAutoCommit(false)?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "When use Batch update,would i must setAutoCommit(false)??" Watch "When use Batch update,would i must setAutoCommit(false)??" New topic
Author

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

alex han
Ranch Hand

Joined: Dec 13, 2002
Posts: 46
i have code like this
Ram Mohan
Ranch Hand

Joined: Jan 19, 2004
Posts: 44
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


If quitters never win, and winners never cheat, who's the idiot that said: Quit while you're ahead?
Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
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

Joined: Dec 13, 2002
Posts: 46
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When use Batch update,would i must setAutoCommit(false)??
 
Similar Threads
reading a very complex file and inserting in database
JDBC Performance Win vs. AS/400
Storing blob > 4kb in oracle db through jdbc
Batch update in EJB
set commit size in spring