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 ?