I'm trying to slowly modernize a DAO-based EJB 1.0 app. The existing code operates on raw jdbc connections, opens a connection-level transaction and hands me the connection (it will also commit the connection once the call to my new code is done). I now like to open an entity manager on top of this connection. While it's possible by subclassing the HibernateEntityManager (overwriting openSession()), I am looking for a better way to do this and haven't been able to find one.
Ideas? Besides rewriting all legacy code? :-)
Cheers,
Jochen
|