Re: connection pooling in JDBC driver

From: arkin <arkin(at)intalio(dot)com>
To: Richard Bullington-McGuire <rbulling(at)microstate(dot)com>
Cc: Gunnar R|nning <gunnar(at)candleweb(dot)no>, arkin(at)exoffice(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: connection pooling in JDBC driver
Date: 2001-03-12 22:19:39
Message-ID: 3AAD4B7B.A5B40223@intalio.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Richard Bullington-McGuire wrote:
>
> On 9 Mar 2001, Gunnar R|nning wrote:
>
> > [snip] Of course your milage may vary, but this is not really a pgsql
> > related question... ;-D Unless of course we are talking about implementing
> > pooling for the DataSource class, but that is somewhat unrelated as well...
>
> That's something that I'm a bit confused about -- there is very little
> documentation on the DataSource class in the sources. One comment in
> particular confuses me:
>
> /**
> * This is a pool of free underlying JDBC connections. If two
> * XA connections are used in the same transaction, the second
> * one will make its underlying JDBC connection available to
> * the pool. This is not a real connection pool, only a marginal
> * efficiency solution for dealing with shared transactions.
> */
>
> This is not a real connection pool?
>
> It seems to me that the JavaDoc for this class should be expanded to
> explain more just what kind of pool it provides.

It's a connection sharing pool.

If two JDBC Connection objects are used in the same transaction, they
will need to use the same underlying connection, since there's not
support for the XA API. When performing asynchronous commit, the
connection will be put aside until it commits, and the JDBC Connection
object might need to use a different underlying connection.

Because of all this connection switching logic, I've implemented a very
simple connection pool that is just used to recycle the underlying JDBC
connection across many client-side JDBC connections. It's not a full
connection pool.

If you are looking for a fully featured connection pool, see
http://tyrex.exolab.org.

arkin

>
> --
> Richard Bullington-McGuire <rbulling(at)microstate(dot)com>
> Chief Technology Officer, The Microstate Corporation
> Phone: 703-796-6446 URL: http://www.microstate.com/
> PGP key IDs: RSA: 0x93862305 DH/DSS: 0xDAC3028E

--
----------------------------------------------------------------------
Assaf Arkin arkin(at)intalio(dot)com
CTO, Intalio Inc. www.intalio.com
The Business Process Management Company (650) 345 2777

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2001-03-13 00:18:21 JDBC autocommit versus own commits performance
Previous Message Eric Frazier 2001-03-12 21:43:55 Re: getTables is this right?