Hi,
I am just investigating the use of Hibernate with EJBs (stateless session only.) The threadlocal pattern looks like the definitive technique to use to grab the appropriate hibernate session (am i correct?!) I was just hoping that a few of you experienced users could help me clarify a few things:
1. I still want to use container declarative transactions in my stateless session beans as per usual - am I right in assuming I can do this? In which case, I guess I don't need to call the session.beginTransaction() etc, right? So is it really as simple as just grabbing the session from my HibernateSessionUtil helper when needed and calling the (eg) save method for my object?
2. I guess I simply close the session at the end of my transacion in the stateless session bean, with nothing more to do than that? (ie no commit as it's container-handled)
3. Does all still work fine with nested EJB calls?
If there's any good documentation out there as to setting this kinda thing up (I'm sure loads of people must need to do it!) please feel free to drop a few URLs into a reply!
thanks loads!
mike
|