This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JDBC and the fly likes Deadlock. Is executeBatch() one transaction? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Deadlock. Is executeBatch() one transaction?" Watch "Deadlock. Is executeBatch() one transaction?" New topic
Author

Deadlock. Is executeBatch() one transaction?

Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
    
    1
I'm encountering a dead lock situation (infrequent) that is narrowed down to the following scenario.

One regular sql statement is calling the following, deleting possibly thousands of rows

"delete mytable where date = ?"

At the same time, a second job is calling the following sql using batched execution

"delete mytable where date = ? and username =?"

For both calls, autoCommit is not set to FALSE. (true by default)

My suspicion is that executeBatch() in the 2nd sql is somehow allocating more than one sql statement to a transaction. If this is the case, is this a JDBC spec behavior? Or is this oracle jdbc driver implementation bug?
[ August 12, 2008: Message edited by: Justin Chu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deadlock. Is executeBatch() one transaction?
 
Similar Threads
addBatch and executeBatch
JDBC manually commit
what is difference between JDBC1 and JDBC2 ?
SQL Insert and Delete at same time?
how to rollback in java