Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1.3
I'm using Hibernate with Websphere Application Server 6.0 with CMT.
I have configured
hibernate.transaction.factory_class=org.hibernate.transaction.CMTTransactionFactory
hibernate.transaction.manager_lookup_class=org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
My question is: is this thread safe in this enviroment:
Code:
public static Object getById(Session aSession, Long aId, Class aClass,
boolean lock) throws HibernateException, DBONotFoundException {
Object back = null;
if (lock) {
back = aSession.get(aClass, aId, LockMode.UPGRADE);
} else {
back = aSession.get(aClass, aId);
}
if (back == null) {
throw new DBONotFoundException("Data Object not found", aClass, aId);
}
return back;
}
[/code][/u][/i]