Re: PdataStreamIterator bug?

Roché Compaan <roche-kb4xc5yObU3kQYj/0HfcvhBnub05S5/[email protected]> Thu, 25 May 2006 18:15:01 +0200
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Organization Upfront Systems
Message-ID <[email protected]>
On Thu, 2006-05-25 at 12:41 -0300, Sidnei da Silva wrote:
> On Thu, May 25, 2006 at 05:27:55PM +0200, Roché Compaan wrote:
> | Again, I don't see what the difference is between reading from Pdata or
> | from a tempfile. The ZODB connection can be closed while reading from a
> | tempfile too.
> 
> The previous code was exactly like that.

Are you referring to the code that returned str(data)?

> It won't fail if the pdata objects are in-memory. It will fail when
>  they are ghostified. The error is 'cannot load state while connection
>  is closed'. I'm sure you have seen that before.

I know the error - I just don't understand why it occurs in this
particular case.

In my understanding of the ZODB, an object is only ghostified if it
hasn't been accessed in a long time and it isn't referenced by the cache
manager, or the transaction aborts. Since we are returning the data on
Pdata objects while accessing them, I don't understand how they can
suddenly be ghostified.

How can I re-create the behaviour you describe? Or what is the
circumstances under which this error becomes likely.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642