Wolfgang Schnerring wrote:
> Hi,
> I'm working with Theuni on the BlobStorage, and am trying to understand the
> different 2-Phase-Commit protocols that are in use in ZODB at the same time.
> As I understand it, tpc_* is the old protocol, and prepare/commit is the new
> protocol.
> The sequence in Transaction._commitResources is
>   tpc_begin      (ignored by DataManagerAdapter)
>   commit         (ignored)
>   tpc_vote       (translated to prepare)
>   tpc_finish     (translated to commit)
> Which means, the old protocol is completed first, before the new protocol is
> even started.
> Now, Connection uses the old protocol, and we've got a BlobDataManager that 
> uses
> the new protocol. The BlobDataManager needs to do work during prepare, but it 
> is
> only called to do this work *after* the Connection has already committed.
> Needless to say, the commit fails, because the preparation hasn't been done.
> Maybe I misunderstood the protocol and the preparation work should be handled
> differently. In any case I'm rather confused by this double-protocal situation
> and would be grateful if someone enlightened me here.

Short annotation from me: The protocol only fails on windows because the
job of the BlobDataManager is to close all open file handles as a
preparation to commit the data. This has to happen before the Connection
(which implements storeBlob) can possibly rename the dirty blob files to
the committed file names.

So the other question would be: is there a way to assure that blob data
managers are always considered first (using the sort key)

Is the approach we are dealing with the right one? Or should the
connection or storage have enough knowledge about the blobs to tell them
to close all open file handles before renaming them? (The storage pretty
likely shouldn't, but the connection might IMHO)


gocept gmbh & co. kg - forsterstra├če 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development

Attachment: signature.asc
Description: OpenPGP digital signature

For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to