Re: Postmaster not dropping connections on tomcat restart.

From: Harry Mantheakis <harry(at)mantheakis(dot)freeserve(dot)co(dot)uk>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Postmaster not dropping connections on tomcat restart.
Date: 2004-03-22 19:11:21
Message-ID: BC84EAD9.C8A3%harry@mantheakis.freeserve.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Paul

How have you set up connection pooling? (Did you follow the Tomcat How-to?)

Also, what version of Tomcat are you running?

Tell us more (copy and past your code fragments) about how you set it all up
and we might be able to help you.

> when i reload my web app that
> the connection stays around...

If you set up the connection pooling as a global JNDI resource, then I can
imagine that reloading a particular web app would NOT cause that connection
pool to stop and start.

Setting up the DataSource as a context resource may be preferable.

> after enough connections are
> just sitting there, it doesn't
> allow me to make anymore...

How many connections is that?

Are you taking care to *always* close your connections within 'finally'
blocks? That is essential, to prevent connection leaks, which is what you
might be suffering from.

Regards

Harry Mantheakis
London, UK

> Dear List,
>
> I've finally managed to get connection pooling going in tomcat. I've
> noticed that when i reload my web app the postmaster will not drop any
> of the connections.
>
> Basically the order of things is I start Tomcat, check out my servlet
> and there's a connection that shows up to the postmaster. Now while
> I've been doing some development I notice that when i reload my web app
> that the connection stays around. And after enough connections are
> just sitting there, it doesn't allow me to make anymore. It gives a
> JDBC error about not being able to make any more connections without
> superuser status.
>
> I'm not even sure if this would be a problem in production, but right
> now I'm finding it quite annoying to have to restart tomcat on a
> regular basis.
>
> Before I get flamed, I just want to note that I'm only asking here
> because I don't even know if this is a postgresql problem or a tomcat
> one. So I'm asking on both mailing lists.
>
> Thanks,
> Paul Davis.
>
> *Insert witty quote*
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2004-03-22 20:36:50 Re: Postmaster not dropping connections on tomcat restart.
Previous Message Paul Thomas 2004-03-22 18:09:29 Re: Postmaster not dropping connections on tomcat restart.