File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Question about TRANSACTION SERIALIZABLE... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Question about TRANSACTION SERIALIZABLE..." Watch "Question about TRANSACTION SERIALIZABLE..." New topic


Ranch Hand

Joined: Jul 06, 2001
Posts: 257
I know that it's possible to set the transaction isolation level on a Connection object using setTransactionIsolation(int), but I'm not clear as to what affect this has on concurrent updates to the database.
Lets say that two clients are using two separate connection objects, both of which have previously called setTransactionIsolation( TRANSACTION_SERIALIZABLE). I know that setting TRANSACTION_SERIALIZABLE on a connection object should guarantee that transactions will be executed serially, such as in a sequence. But if the two previously mentioned clients both call setAutoCommit(false) on their own connection object, perform some updates to the database, then call commit(), will these transactions occur sequentially? I mean, will the transactions overlap at all?
catch y'all later
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
I'm not so sure, but that isolation level guarantees that everytime they read something in that transaction, they will get the same results every single time. If they try to update a row that has changed since the transaction started, then the get an error. When, actually, this may depend on the implementation of the DBMS. The above is true at least for Oracle.
Good luck!
I agree. Here's the link:
subject: Question about TRANSACTION SERIALIZABLE...
It's not a secret anymore!