Saga continues ([Zope-DB] DCOracle2: close connection doesn't)

Bo M. Maryniuck b.maryniuk at forbis.lt
Mon Sep 29 04:29:47 EDT 2003


Hi, Dieter!

On Sunday 28 September 2003 22:22, Dieter Maurer wrote:
> It is more likely a "bug" in your understanding:
>
>   Each ZODB connection has its own copy of a ZODB object
>   and therefore its own volatile attributes.

Hm. Does it mean that they are messed up (see below)?

>   When you delete a volatile attribute in one connection,
>   then this copy no longer has it. But that does not say
>   anything about the copies in the other connections.

OK, I did very-very-very simple test-product, which certainly only do on 
manage_afterAdd():

	self._v_test_connection = DCOracle2.connect('asdf at qwer/zxcv')

And the method teardown() thich should close the connection. It does:

	self._v_test_connection.close()
	self._v_test_connection = None

	del self._v_test_connection # This is really optional

So I had turned off any connection, have a pure plain Zope instance without 
any connection, than had runned SQL to select active Oracle users from 
p$session view and got no one in result. OK, let's go test it. 

Now I had added my test to ZODB and run p$session SQL again. Now I see one 
active session, exactly I did it. Now, I call teardown() method which means 
"Close Oracle session and disappear forewer". And after that I had deleted 
the test object at all. After that, SQL still shows me active connection. 
Huh?! Why???

So below is the interesting questions, which I really would like to get it 
know:
1. Why my understanding is buggy, when I set my volatile to None and Zope 
still keeps the connection? Should Zope garbagecollect it instead?
2. Why I think wrong, if I had DELETED this UNIQUE volatile and, in theory, 
Zope has no one else anymore but Oracle session still opened?
3. Why I did Control_Panel.Database.manage_minimize() and Oracle session 
finally dissapeared?
4. How else to say to my volatile: "Die immediately and release Oracle 
session!" in Python code, except call close(), delete it and set it to None?

I really interested and would be very nice if You let me know it. Thank You 
much.

NOTE: May be this will help to find the answers: Zope 2.5 seems works much 
better in this case. Does 2.6 and 2.7 has some changes with volatile 
attributes since v. 2.5?..

-- 
Regards, Bogdan M.Maryniuck

System programmer, Forbis UAB





More information about the Zope-DB mailing list