File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Database Connections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Database Connections" Watch "Database Connections" New topic
Author

Database Connections

Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 279
I haven't had an opportunity to run a test yet but I am hoping someone can answer a quick question which is this:

If I have a database Connection object, setAutoCommit to false, execute 1 or more UPDATE statements, then execute a SELECT before invoking commit, will the SELECT return the database table values prior to the UPDATEs or will it return the updated table values?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

It depends on which RDBMS you are using and what the default transaction isolation level is.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
If using same connection object for retriving as well, most probably records after updation would come up.

But yes as paul said depends upon isolation level. If level is set to READ COMMITTED then it wouldn't read uncommitted records.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Database Connections
 
Similar Threads
Selecting all columns but one
Like % question Criteria
How must i "synchronize" my servlets?
Couldn't Load Database Driver
Insertion Of Data