-->
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.  [ 2 posts ] 
Author Message
 Post subject: two webapps, one dao?
PostPosted: Wed Mar 08, 2006 1:50 pm 
Newbie

Joined: Mon Feb 20, 2006 3:27 pm
Posts: 4
Folks, I have two webapp contexts under tomcat, and I want them to use a common dao.

So I want to split out our hibernate classes and the hbms into their own jar file... like their own eclipse project... DAO. Then make my two webapps dependent on this DAO project.

Is this possible, or do I need to have the *.hbm.xml files physically exist in each web app?

That is to say, each webapp would have a dao.jar with the DAO classes and hbms in there.. will this work? Is there anything special I have to do for this.. reference the hbm files differently?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 08, 2006 2:29 pm 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
For this problem, you should look towards an application server, not just a web server. JBoss has good integration with Hibernate and Tomcat so it will be easy for you.

Basically you will need to deploy 3 applications : 2 webapps (each one in a WAR file) and one Hibernate service (containing your Hibernate beans and you .hbm.xml files). This way you will access a single SessionFactory through JNDI.

If you want to save yourself some configuration steps you can package the whole thing (2 webapps + 1 Hibernate service) in a single EAR. This will be easier to deploy.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.