You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Chris Lewington <cl...@ebi.ac.uk> on 2003/05/27 16:58:15 UTC

Oracle Cursors, Connections etc

Hi all,

Posted a problem about 'open cursors' with oracle recently - thanks to
everyone who replied (ie Jason McKerr). For info I got around it by
using the fact that PB transactions close connections. If I use that in
conjunction with the oracle driver that has a built-in cache then the
problem goes away, as the connection only gets returned to the pool and
is cleaned up ready for reuse.

Two questions arise for me about this (if these are fixed after 0.9.7
please ignore and just tell me to upgrade):

1) Why doesn't the OJB connection pool clean up the connections before
making them available again? The PB pool instances get cleaned up, I
believe.

2) Why does pb.commitTransaction() close the connection? I would have
thought that in general one would want to maybe do more than one
transaction for a given connection (read session).

Cheers,

Chris


Re: Oracle Cursors, Connections etc

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Chris,

(concerns current version)
dependend on 'ConnectionFactoryClass' property
in OJB.properties, OJB close a used connection or
return it to connection-pool.

Per default OJB use a connection-pool. Only
DataSource objects (connections) will never be pooled.

> 2) Why does pb.commitTransaction() close the connection?
The PB instance release the used connection as soon as
possible to 'save' connection resources. If a connection-pool
was used the connection was only returned to pool after
pb.commitTransaction().

HTH
regards,
Armin

----- Original Message -----
From: "Chris Lewington" <cl...@ebi.ac.uk>
To: <oj...@db.apache.org>
Sent: Tuesday, May 27, 2003 4:58 PM
Subject: Oracle Cursors, Connections etc


> Hi all,
>
> Posted a problem about 'open cursors' with oracle recently - thanks to
> everyone who replied (ie Jason McKerr). For info I got around it by
> using the fact that PB transactions close connections. If I use that
in
> conjunction with the oracle driver that has a built-in cache then the
> problem goes away, as the connection only gets returned to the pool
and
> is cleaned up ready for reuse.
>
> Two questions arise for me about this (if these are fixed after 0.9.7
> please ignore and just tell me to upgrade):
>
> 1) Why doesn't the OJB connection pool clean up the connections before
> making them available again? The PB pool instances get cleaned up, I
> believe.
>
> 2) Why does pb.commitTransaction() close the connection? I would have
> thought that in general one would want to maybe do more than one
> transaction for a given connection (read session).
>
> Cheers,
>
> Chris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>