aspose file tools*
The moose likes JDBC and the fly likes JDBC Isolation level? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Isolation level?" Watch "JDBC Isolation level?" New topic
Author

JDBC Isolation level?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9381
    
    2

Guys,

What is called a JDBC Isolation level?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Its the level of isolation a transaction uses. Databases support different isolation levels that usually represent a trade of of data integrity vs. performance. For example the isolation level TRANSACTION_SERIALIZABLE means the database treats the transactions as if they are serial (i.e. one transaction at a time) so you get high guarentees of data integrity, but poor performance. At the other end you have TRANSACTION_READ_ UNCOMMITTED which allows other transations to read data that has yet to be committed. So you will get what are know as "dirty reads", but much improved performance since nothing is blocking a read.

Have a read of the JavaDocs for java.sql.Connection, it has some static variables defining the transaction isolation levels a database may support.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9381
    
    2

I understood your explanation. But what would be the choice to go?? Level 4 or Level 0?? or does it purely depend on the necessity to use either Level 4 or Level 0??
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Originally posted by Jothi Shankar Kumar Sankararaj:
But what would be the choice to go?? Level 4 or Level 0?? or does it purely depend on the necessity to use either Level 4 or Level 0??

Yes. You will know if your application can support dirty reads, or needs the absolute data integrity supplied by serializable isolation. Have a read of this.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9381
    
    2

I'll try the link and post if any further doubts that I might have.

Thanks for the link!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC Isolation level?