We started using Hibernate 3.0 a few weeks now and it works really well. However, we have one issue. Is there a way to find the associated Session for the persistence object.
For example, customer is a persistence object and to find the associated persistence manager (similar to Session), JDO provides JDOHelper class to find the persistence manager associated with the persistence object.
PersistenceManager pm = JDOHelper.getPersistenceManager(customer);
We have two data sources and we would like to know which session the customer associated with. The business layer is implemented to handle the multiple data sources by finding the corresponding persistence manager from the passed persistence object. This approach worked well for us in JDO environment but maybe this is not the right approach in Hibernate.
Thanks, Hibernate newbie
Hibernate version:
3.0
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|