-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Dirty reads without changing transaction isloation?
PostPosted: Mon Apr 02, 2007 3:07 pm 
Beginner
Beginner

Joined: Tue Nov 29, 2005 4:42 pm
Posts: 49
Location: Atlanta, GA
I have a legacy database that I'm mapping with hibernate, and my DBAs are asking if I can make my hibernate statements use dirty reads. I know all of the issues this brings up, and I know it's not safe. And, I've been through all of those discussions with my DBAs and they're not statisfied. I know I can turn down my transaction isloation level from read committed to read uncommited, but I was wondering if there is a way to provide locking hints in certain cases to request dirty reads from a higher transaction isloation level?

Thanks
Charlie


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 02, 2007 3:34 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You can only change the whole default connection isolation to read uncommitted, not for individual statements. Let me guess, IBM DB2? Fire these guys before they do more damage to your company. I'm serious.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 02, 2007 3:36 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Oh, forgot the DB2 trick for "performance": Implement org.hibernate.Interceptor.onPrepareStatement() and append "WITH UR" or whatever your "DBA" tells you.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 02, 2007 3:54 pm 
Beginner
Beginner

Joined: Tue Nov 29, 2005 4:42 pm
Posts: 49
Location: Atlanta, GA
Actually it's MS SQL Server. :-( They add the "NO LOCK" hint on the SQL statements instead of the "WITH UR" to get dirty reads. So by creating an Interceptor I could add the lock hint if I so wished. Ok good to know. Not sure if I'll have to do it, but good to know.

Thanks
Charlie


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.