-->
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: Advice needed to integrate Hibernate with Tomcat 4.18
PostPosted: Thu Apr 15, 2004 1:07 am 
Newbie

Joined: Sat Jan 24, 2004 8:54 am
Posts: 4
Location: Bangladesh
hi

i'm using --

Tomcat 4.18
Struts
Hibernate 2.1
Oracle 9i

now i'm facing some problems, it would be very much helpful for us if we get those solution.

1. now I'm using Tomcat and Hibernate as standalone. here Hibernate creates a new session when first time database access is needed (if there is no old created session). but now i want some help to intregate Hibernate with Tomcat to create the session during Tomcat startup. and is this approach better than the previous one?

Looking forward to your valuable comments!

Best regards,.

tanver

_________________
I changed from Hibernate 1.2 to Hibernate 2.1 and now giving 'out of memory' error while performing 20 or more operations


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 1:16 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Quote:
here Hibernate creates a new session when first time database access is needed (if there is no old created session). but now i want some help to intregate Hibernate with Tomcat to create the session during Tomcat startup

Do you mean session or session factory? You would want to create your session factory once and then use sessions as per the patterns below.

There are several well documented patterns for integrating hibernate with a web container (open session in view, thread local session, disconnected session etc). You should select the one most appropriate based on your architecture.

Personally I have found the open session in view pattern (using a filter to open/close sessions) easy to use in smaller web applications where the domain model is shared between all layers of the system.

Perhaps you should try this one out. It also circumvents many of the faq type problems that people often stumble upon (lazily initialisation etc)

Regards
Justin


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.