File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database Connections

 
Jay Damon
Ranch Hand
Posts: 282
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on which RDBMS you are using and what the default transaction isolation level is.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic