-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate code using different isolation levels in J2EE 1.3
PostPosted: Wed May 18, 2005 11:32 am 
Senior
Senior

Joined: Tue Aug 03, 2004 2:11 pm
Posts: 142
Location: Somerset
We have issues with hibernate based queries locking records when they shouldn't be (they are jsut being read).

After a lot of searching I found this excellent article

http://www-912.ibm.com/s_dir/slkbase.NS ... enDocument

Essentially what it says is that in a J2EE 1.3 module, you cannot define differnt isolation levels for at EJB method or bean level.

What you have to to do is set up resource references back to datasources (they can all point ot the same datasource), then in websphere you tie a particular isolation level to a resource reference, and when you application wants to do something at a particular isolation level, you grab a connection from the resource reference for that isolation level.

Which is fine. For hand crafted JDBC based methods that is.

In Hibernate though from the code I've seen you tend to have a single session factory for the application, that is tied to a single datasource (via a resource reference of course), thereby giving all hibernate code the same isolation level.

Is there an easy way of setting up hibernate so that some methods can use a read only datasource reference, and others use datasource references that are going to lock records ?

_________________
On the information super B road


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

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.