-->
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: SessionFactory Question
PostPosted: Tue Nov 28, 2006 5:32 pm 
Newbie

Joined: Tue Nov 28, 2006 4:56 pm
Posts: 1
Does it ever make sense or better yet is it possible to share the Session Factory among multiple Web Applications? For instance, I have written multiple Struts apps that are unique and should not be grouped, but they do have one thing in common, they all share the same DB. Is it necessary to load the entire mapping into memory for each app or is there a way around this?

I tried removing the <listener> from all but one app and monitored tomcat while exercising the app. When Tomcat starts it Configures Hibernate from the remaining <listener>, but when one of the other apps tries to create a session from the SessionFactory it maps the entire DB into memory.

I also tried creating an app that contained the <listener> with a web page to links to all the other apps. That way you would be sharing the same Interent Explorer (Http) session. Yes, I realize that a Hibernate Session is not the same as the Http Session, but what the heck I gave it a try and had no luck.

F.Y.I. I am using Hibernate3 with Tomcat 5.5 and I have implemented the <listener> to load the Configuration on deployment.

Thanks for your time!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 7:29 pm 
Senior
Senior

Joined: Sat Nov 27, 2004 4:13 am
Posts: 137
well each web application inside Tomcat has it's own ClassLoader,... but I believe you can bind your only SessionFactory as a resource in Tomcat jndi..., go to Tomcat documents....

_________________
don't forget to credit!

Amir Pashazadeh
Payeshgaran MT
پايشگران مديريت طرح
http://www.payeshgaran.co
http://www.payeshgaran.org
http://www.payeshgaran.net


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.