| From: | "Simon Stanlake" <stanlake(at)hi(dot)ca> | 
|---|---|
| To: | <pgsql-jdbc(at)postgresql(dot)org> | 
| Subject: | max connections | 
| Date: | 2001-08-29 21:38:21 | 
| Message-ID: | HAEJICIELCMBEJEIAMMACEDFCGAA.stanlake@hi.ca | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-jdbc | 
Hi,
The documentation states that the Connection object is thread-safe... I took
this to mean I can create a connection as a singleton and pass it out to all
my threads with no worries.  When I did this I noticed that a
SimpleObjectPool was being created, and I would occasionally get a "max
connections exceeded" error from the database.  I assume this means the
implementation actually creates a connection pool and passes connections out
to threads as needed.
My question is... what is the proper way to handle postgres connections in a
multithreaded environment?  is it OK to create a singleton of the
connection?  if so, is there a way to limit the number of connections the
pool makes to the database so that the maximum is not exceeded?
_______________________________
Simon Stanlake
Harmony Integrated Systems Inc.
http://www.hi.ca
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rene Pijlman | 2001-08-29 21:55:30 | PostgreSQL/JDBC Test Suite Howto | 
| Previous Message | Liam Stewart | 2001-08-29 18:16:50 | Re: Status of JDBC test suite? |