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

Matthew T. Kromer matt at zope.com
Wed Sep 24 11:40:59 EDT 2003

Chris Withers wrote:

> ...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?

The open/closed marker is useless in ZOracleDA.  Any rewrite should 
either fix this or eliminate the marker.  The ONLY thing it ever let you 
do was try new connection strings out.

>> 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?

Bo sent me some replacement files, not patches, and I haven't taken the 
time to look at what he did.  There are probably huge comment blocks, 
but I much prefer reading unified diffs.

> 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?

I dont expect Z SQL methods to get new cursors at all, they should just 
use the implicit cursor in the connection object, I think.

>> 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* Zope's debug panel can see them =/  I dont know if it ever shows 
dco2 objects.

> > 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?

No, anything that goes thru the normal DCOracle2 python layer has the 
dco2 layer ResultSet objects removed.  The result set is sort of a 
scrolling window, that holds pure Oracle data, not python objects.

> cheers,
> Chris
> PS:
>>> 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?

You probably can, we're soliciting people to help maintain what is zope.org.

Matt Kromer
Zope Corporation  http://www.zope.com/ 

More information about the Zope-DB mailing list