Re: Submittal for JDBC Pooling driver (For 7.3)

Поиск
Список
Период
Сортировка
От Kovács Péter
Тема Re: Submittal for JDBC Pooling driver (For 7.3)
Дата
Msg-id 8A2DDD7ED7876A4698F6FF204F62CBFC01EC4539@budg112a.sysdata.siemens.hu
обсуждение исходный текст
Ответ на Submittal for JDBC Pooling driver (For 7.3)  (Ned Wolpert <wolpert@yahoo.com>)
Ответы Re: Submittal for JDBC Pooling driver (For 7.3)  (Ned Wolpert <wolpert@yahoo.com>)
Список pgsql-jdbc
Ned,

I am referring to code under the PostgreSQL CVS repository in the directory
src\interfaces\jdbc\org\postgresql\xa plus the class in
src\interfaces\jdbc\org\postgresql\PostgresqlDataSource.java. There is no
indication that this code would be part of a project called Tyrex (or any
project other than PostgreSQL for that matter).

My understanding is that with this code ("xa" package & the class
PostgresqlDataSource) the driver fully meets the requirements set out in
sections "Connection Pooling" and "Distributed Transactions" of the JDBC 2.0
Optional Package Spec. (Distributed transactions are supported by the
Exoffice package only to the extent the underlying backend supports them.
That is, in case of PostgreSQL only one_phase_commit is meaningful. But due
to lack of support in the backend, you would not want to use PostgreSQL in
distributed transactions anyway.)

Also, my understanding of the optional spec is that implementing a "pooling
system" is the responsibility of the application server provider. The "xa"
package already provides the interface which the application server provider
will have to rely on to implement connection pooling. I admit that there is
(probably) a small twist in the behaviour of the Exoffice implementation:
because a physical PostgreSQL connection cannot join a transaction initiated
by another physical PostgreSQL connection, a physical connection
participating in a transaction is "pooled" between XAConnections
representing the same transaction. This means that physical connections may
be decoupled for a limited period of time (in the worst case by the time the
transaction timeout expires) from their logical representation
(XAConnections) dealt with by the application server vendor's pooling
system. This means that, now and then for a limited period of time, there
may exists more open physical connections than the application server
vendor's pooling system might think. (There is also another
resource/physical connection leakage potential which I discuss in another
related thread. But this one is rather a buglet.)

Again, this behaviour is due to the limitation in the PosgtreSQL backend
(physical connections cannot share the same transaction (is it accurate?))
and I think this irregularity is a small price to pay for the ability to
integrate PostgreSQL in a very demanding environment (even if the scope of
this integration is limited to what PostgreSQL is really capable
(one_phase_commit)).

(Just a brief recap: the XADataSource extends the ConnectionPoolDataSource
interface and the XAConnection interface implements the PooledConnection
interface.)

Peter


> -----Original Message-----
> From: Ned Wolpert [mailto:wolpert@yahoo.com]
> Sent: Wednesday, January 02, 2002 3:32 PM
> To: Kovács Péter; pgsql-jdbc@postgresql.org
> Subject: RE: [JDBC] Submittal for JDBC Pooling driver (For 7.3)
>
>
> Peter-
>
>   No, this implementation is not related to the Exolab project Tyrex,
> which I believe is the one you're refering to. This implementation
> is so that the JDBC driver has an internal pooling system to make the
> driver compatiable with the jdbc2.0 optional spec.
>
>   With this implementation, you can still use the Tyrex
> package for their
> pooling system.  This just extends the current JDBC driver
> implementation. I submitted this package to help bring the JDBC driver
> up to 2.0 compliance.
>
> --- Kovács_Péter <peter.kovacs@sysdata.siemens.hu> wrote:
> > Hi Ned,
> >
> > How does your implementation relate to the Exoffice XA
> package? I think
> > that
> > the XA layer is very well implemented. My instinctive
> approach would be
> > to
> > add things to the Exoffice package, if we you/we need
> something extra at
> > the
> > PooledConnection level. We may also want to separate the
> two layers into
> > distinct packages, but then we need to (hopefully only
> slightly) change
> > the
> > XA package (which, in its current form, works very nicely for me).
> >
> > Peter
> >
> > > -----Original Message-----
> > > From: Ned Wolpert [mailto:wolpert@yahoo.com]
> > > Sent: Saturday, December 22, 2001 7:38 PM
> > > To: pgsql-jdbc@postgresql.org
> > > Subject: [JDBC] Submittal for JDBC Pooling driver (For 7.3)
> > >
> > >
> > > Folks-
> > >
> > >   I wasn't going to submit this code until 7.2 was
> released, but I've
> > > wanted to have it available for folks to examine.  I'm hoping
> > > to get it
> > > in the 7.3 release.  Its a set of classes that provide a pooling
> > > data source.  Its very similiar to the one I sent in a
> few months ago.
> > > Differences are
> > >   1) Abit more comments
> > >   2) Using pgsqlDriver.properties rather than psqlProps.properties
> > >      for the property reader
> > >   3) Its wrapping all the returned classes so exceptions can
> > > be caught.
> > > As far as point three above goes, if my classes are accepted,
> > > I'd rather
> > > patch the jdbc2 classes to notify the driver instead of
> wrapping.
> > > The code is usable now, but your millage may varry.  Please
> > > take a look
> > > and comment.
> > >
> > > Thanks.
> > >
> > > =====
> > > Virtually,        |                   "Must you shout too?"
> > > Ned Wolpert       |                                  -Dante
> > > wolpert@yahoo.com |
> > > _________________/              "Who watches the watchmen?"
> > > 4e75                                       -Juvenal, 120 AD
> > >
> > > -- Place your commercial here --                      fnord
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Send your FREE holiday greetings online!
> > > http://greetings.yahoo.com
> > >
>
>
> =====
> Virtually,        |                   "Must you shout too?"
> Ned Wolpert       |                                  -Dante
> wolpert@yahoo.com |
> _________________/              "Who watches the watchmen?"
> 4e75                                       -Juvenal, 120 AD
>
> -- Place your commercial here --                      fnord
>
> __________________________________________________
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
>

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Ned Wolpert
Дата:
Сообщение: Re: "persistent" connection in a Servlet
Следующее
От: Kovács Péter
Дата:
Сообщение: Re: What happend to the Exoffice XA package?