Re: How can I to solute this problem? - Mailing list pgsql-sql

From Paul Thomas
Subject Re: How can I to solute this problem?
Date
Msg-id 20030729082305.A23245@bacon
Whole thread Raw
In response to How can I to solute this problem?  ("LEON" <ldai@accunettech.com>)
Responses Re: How can I to solute this problem?
Re: How can I to solute this problem?
List pgsql-sql
On 29/07/2003 07:18 LEON wrote:
> I use tomcat+linux_postgresql+jsp to develop system.
> 
> I start postgresql with 1024 processes.
> FE:
> postmaster -i -S -N 1024 -B 2048 -D /var/lib/pgsql/data
> 
> My jsp doesn't implement connection pool.It directly connects postgresql
> by jdbc.

IME, that is not a good way to do it. Use a connection pool.

> After I run the Ui some times, the UI(jsp) would report "ieSorry,too many
> clientslg" .The exception is SQLException.
> 
> I must restart tomcat or postgresql I can continue to running my UI.

My guess would be that you have a bug in your application which is not 
always closing the connection so eventually you exceed max_connections. 
You should always close the connection in a finally{} block so that is 
guaranteed that it will be closed regardless of any earlier exceptions 
which are thrown.

HTH

-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller 
Business |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+


pgsql-sql by date:

Previous
From: "LEON"
Date:
Subject: How can I to solute this problem?
Next
From: Achilleus Mantzios
Date:
Subject: Re: How can I to solute this problem?