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?
Harmony Integrated Systems Inc.
pgsql-jdbc by date
|Next:||From: Rene Pijlman||Date: 2001-08-29 21:55:30|
|Subject: PostgreSQL/JDBC Test Suite Howto|
|Previous:||From: Liam Stewart||Date: 2001-08-29 18:16:50|
|Subject: Re: Status of JDBC test suite?|