Re: Another exception (Transaction level)

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Ole Streicher <ole-usenet-08(at)gmx(dot)net>
Cc: Postgres JDBC <pgsql-jdbc(at)postgresql(dot)org>, Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
Subject: Re: Another exception (Transaction level)
Date: 2003-07-25 14:23:44
Message-ID: 1059143024.10668.24.camel@coppola.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> > Concurrently? Do you mean that you a sharing one connection between
> > several threads?
>
> Yes. I didn't see a hint why this should be problematic.

You should use a connection pool: open a few connections beforehand, and
each thread can then request one for it's exclusive use, and then give
it back after finishing. There are lots of possible
strategies/variations you could apply to the nr. of initial connections,
how to grow/shrink that depending on load, what happens if there are too
many connections open and there's a new connection (you can wait or
throw exception), etc.
Google around or search this list for "connection pool" and I'm sure
you'll find a lot of hints and code examples.

Cheers,
Csaba.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2003-07-25 14:28:00 Re: Another LargeObject problem
Previous Message Ole Streicher 2003-07-25 14:15:03 Re: Another exception (Transaction level)