All--
First some background:
I'm currently using CMT where the session bean that opens the session and stores it in thread local storage, invokes a method (eg. createUser) on a DAO, rolls back the transaction if necessary and closes the session.
I've also developed a DAOthat gets the current session from thread local storage, calls the appropriate method on the session (eg. save), and wraps hibernate exceptions into a PersistenceException.
Now for the question:
Instead of the EJB opening the session and storing it in thread local storage to ensure that the same session is used within a single transactions, do repeated calls to the HibernateFactory's openSession method ensure that the same session is returned within a single transaction?
|