[Zope-DB] DCOracle2: close connection doesn't

Chris Withers chrisw at nipltd.com
Wed Sep 24 11:26:16 EDT 2003

Matthew T. Kromer wrote:
> Chris Withers wrote:
>> Not sure what you mean. If I push the close button on the DA object, 
>> it says it's 'closed'. In that state, I wouldn't expect a transaction 
>> to re-open it, but if it did, I'd expect the DA's state to change to 
>> 'open'. That doesn't appear to happen ;-)
> DA's auto-open when they're used.

...which seems 'bad' to me. They also auto open as they're unpickled from the 
ZODB (see the __setstate__ method in Connection.py).
Which makes me wonder why the open/closed marker is there at all, and what it 
means when it says closed? Is it ever accurate?

> Bo Maryniuck thinks that you can just patch the ZOracleDA close to close 
> the default cursor as well when the connection closes and that should 
> stop leaks.

Indeed, although he has reported success with this, and as well as the 
'ORA-03114', I'm battling against apparently leaking Oracle connections.
What leads you to believe his patching is in vain?

> The DA doesn't keep track of what cursors its handed out (it would be 
> tricky) and cursors have a reference to their parent connection. 

Hmm, if only ZSQL methods are being used, how would more than one cursor be 
handed out? How would you except these cursors to die, and hence relinquish 
their Oracle connection?

> parent connection doesn't know what cursors use it.  There's code there 
> to say "nuh-uh, I'm closed" when a cursor operation is attempted on a 
> closed connection, but the cursor is still present and chewing up Oracle 
> resources until its closed.

Indeed. This I'd like to avoid. Any idea where the cursors could be leaking away 
to? What would they show up in Zope's Debug panel as?

 > If you use the C layer directly (no one
> does!) you also have to destroy all ResultSet objects as well.

Could cached ZSQL method results have this effect?



>> Glad to see it's not only us non-paying customers who love NZO so much 
>> ;-)
>> Any joy fixing it?
> Erm, no. 

(in a Ren & Stimpy stylee)Oh joy!
Whassup with it? Anything I can do to help?

More information about the Zope-DB mailing list