-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: JDO to Hibernate conversion issue
PostPosted: Tue Apr 05, 2005 10:19 am 
Newbie

Joined: Wed Feb 23, 2005 11:29 am
Posts: 9
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:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 1:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No, because Hibernate does not use bytecode enhancement, this cannot be implemented. Usually you use a thread-bound session, and get access to the session that way. (It is rare to need to have >1 session per thread.)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 1:58 pm 
Newbie

Joined: Wed Feb 23, 2005 11:29 am
Posts: 9
Thank you for responding so quickly. This is not an issue, we just wanted to confirm before revising our implementation. It has been quite a pleasant experience although we had a few issues with WebLogic server (not Hibernate issue).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.