-->
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.  [ 1 post ] 
Author Message
 Post subject: Best way to share hibernate session across Eclipse projects?
PostPosted: Wed Jan 11, 2006 1:14 pm 
Newbie

Joined: Wed Jan 11, 2006 12:59 pm
Posts: 11
Hibernate version: 3.0
Eclipse version 3.1

I am quite new to hibernate, but have been able to integrate it into several of my Eclipse projects. However, I find that the way I have integrated Hibernate into my projects is somewhat inefficient. This is because each project has its own SessionFactory class. Hence, each project must use its own Session. Now, when I deploy my projects to our webserver I have to have a separate hibernate session for each deployed project. This is because project A may need to use some hibernate enabled classes in project B, so I need to have a one hibernate session for Project A classes and one hibernate session for project B classes.

I am wondering what is the best way to organize my Eclipse projects so that all projects can share a single hibernate session. I have tried to create a separate project that only contains a HibernateSessionFactory class and a hibernate.cfg.xml. And then have all projects reference and use this HibernateSessionFactory. However, I am not sure if this the the best way to handle this.

Any thoughts or suggested reference materials would be appreciated. Thanks.


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

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.