-->
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.  [ 4 posts ] 
Author Message
 Post subject: Tomcat context reload and database connection pooling proble
PostPosted: Tue Oct 07, 2003 10:01 am 
Newbie

Joined: Tue Oct 07, 2003 9:37 am
Posts: 3
Location: KwaZulu-Natal, South Africa
Hi

I'm using tomcat 4.0.x, Hibernate 1.2.5 and Postgresql 7.3.

Using Apache DBCP for connection pooling.

The propblem i'm having is this:
The tomcat Context is set reloadable="true" and i don't have access to any of the tomcat configurations. Normally this wouldn't be a problem but when tomcat reloads the context it leaves the old versions connections to the db open and idle. This results in postgresql refusing to issue new db connections after reaching its limit.

I create / load SessionFactory in a Servlet loaded on Context Initialisation.

Is there a way to close those old connections or am i doing somethign to cause this ?

Keep in mind i cannot alter the configs for apache or tomcat myself - only the configs for the web app.

thanks

pd


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 07, 2003 12:50 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Do you then also close the session factory on the context destroyed event?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 08, 2003 3:16 am 
Newbie

Joined: Tue Oct 07, 2003 9:37 am
Posts: 3
Location: KwaZulu-Natal, South Africa
Thanks.

I was using Servlet loaded on startup to do this, You suggestion lead me to the ServletContextListener which seems to be a neater way of doing something that was somewhat messy to start with.

Thanks muchly


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 25, 2004 1:27 pm 
Newbie

Joined: Wed Aug 25, 2004 1:13 pm
Posts: 1
Are there any other possibilities to look into? I'm closing the SessionFactory when the context is destroyed but dead db connections are being left to accumulate. I'm using Postgres 7.3 with Tomcat 4 and 5 (both give the problem) and the JNDI database access method with org.postgresql.jdbc2.optional.PoolingDataSource and org.postgresql.jdbc2.optional.PGObjectFactory.

thanks.


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