Re: [Zope] A question about __setstate__ in Shared/DC/ZRDB/Connection.py

2008-09-30 Thread Dieter Maurer
Marco Bizzarri wrote at 2008-9-20 08:41 +0200:
 ...
I'm working right now with Zope 2.8, which I don't think is running on
that version of ZODB; is is possible to backport such patch to Zope
2.8? I'm not asking to do the work, I'm just asking if, in theory, it
is possible to do it, or if it relies on something which has been
introduced in new releases of ZODB.

Sure. The proposal is age old -- and we are using the implementation
since years -- also in Zope 2.8.

It is a bit more difficult for me to provide a clean patch for the
feature against a stock Zope 2.8 -- as beside this, we have many
other modications/improvements and it is not easy to separate them.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] A question about __setstate__ in Shared/DC/ZRDB/Connection.py

2008-09-20 Thread Dieter Maurer
Marco Bizzarri wrote at 2008-9-19 09:23 +0200:
 ...
I assume therefore that the ZPsycopgDA object has been ghostified,
during the transaction. But this assumption is not supported by any
evidence. In particular, it is not supported by my knowledge of the
internal behaviour of ZODB on objects during a single transaction.

Can anyone provide suggestion on this topic?

Cache garbage collection can happen at savepoint time.
Then, volatile attributes can be lost.

There is an age old proposal
http://wiki.zope.org/ZODB/VolatileAttributeLifetimeGarantee;
which would allow to avoid this problem.

As we use this feature since ages in our local Zope/ZODB
version, I could provide an implementing patch (for ZODB 3.8).



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] A question about __setstate__ in Shared/DC/ZRDB/Connection.py

2008-09-20 Thread Marco Bizzarri
On Sat, Sep 20, 2008 at 8:21 AM, Dieter Maurer [EMAIL PROTECTED] wrote:
 Marco Bizzarri wrote at 2008-9-19 09:23 +0200:
 ...
I assume therefore that the ZPsycopgDA object has been ghostified,
during the transaction. But this assumption is not supported by any
evidence. In particular, it is not supported by my knowledge of the
internal behaviour of ZODB on objects during a single transaction.

Can anyone provide suggestion on this topic?

 Cache garbage collection can happen at savepoint time.
 Then, volatile attributes can be lost.

 There is an age old proposal
 http://wiki.zope.org/ZODB/VolatileAttributeLifetimeGarantee;
 which would allow to avoid this problem.

 As we use this feature since ages in our local Zope/ZODB
 version, I could provide an implementing patch (for ZODB 3.8).



 --
 Dieter



I'm working right now with Zope 2.8, which I don't think is running on
that version of ZODB; is is possible to backport such patch to Zope
2.8? I'm not asking to do the work, I'm just asking if, in theory, it
is possible to do it, or if it relies on something which has been
introduced in new releases of ZODB.

Regards
Marco


-- 
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] A question about __setstate__ in Shared/DC/ZRDB/Connection.py

2008-09-19 Thread Marco Bizzarri
Hi all.

I'm working on an application which uses Zope (2.8, at the moment) and
ZPsycopgDA (toghter with a number of other products).

While writing an acceptance test, I encountered a strange problem: the
test locks up.

A further investigation shown that there were two connections at the
database; one of them was not committed, the other one was blocked
waiting for the other to commit.

I therefore used the pdb in order to stop the execution of the test
inside the connect method of the ZPsycopgDA.DA. Once I had that
breakpoint, I was able to get the logs of the two transactions on the
database, and I had the confirmation that indeed there were two
different transactions.

So, I wondered what could possibily happen, I mean why during a test
there could be a second connect to the database.

I issued a bt to see the stack of calls leading to the connect, and
what I could see was that the coonect was called inside the
__setstate__ method of Shared/DC/ZRDB/Connection.py.

I assume therefore that the ZPsycopgDA object has been ghostified,
during the transaction. But this assumption is not supported by any
evidence. In particular, it is not supported by my knowledge of the
internal behaviour of ZODB on objects during a single transaction.

Can anyone provide suggestion on this topic?

Regards
Marco
-- 
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )