Re: [ZODB-Dev] Problem with handling of data managers that join transactions after savepoints

2010-05-11 Thread Wichert Akkerman
On 5/11/10 19:41 , Chris Withers wrote:
> Jim Fulton wrote:
 I plan to implement A soon if there are no objections.

 Unless someone somehow convinced me to do D, I'll also add an
 assertion in the Transaction.join method to raise an error if a
 data manager joins more than once.
>>> Option A sounds sensible. It also means I won't have to change
>>> anything in the zope.sqlalchemy data manager.
>>
>> Very cool. I was hoping non-ZODB-data-manager authors
>> were paying attention. :)
>>
>> If anyone knows of any other, I would appreciate someone forwarding
>> this thread to them.
>
> zope.sendmail and MaildropHost have data managers.
> I've seen some file-based things that was a data manager and a few
> others in people's BFG stacks, maybe they can pipe up and/or let the
> others of those wsgi components know.

I wrote repoze.filesafe a while ago to do transaction-aware creation of 
files, which uses a datamanager. It never tries to join a transaction 
more than once, so should be fine.

Wichert.
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Problem with handling of data managers that join transactions after savepoints

2010-05-11 Thread Chris Withers
Jim Fulton wrote:
>>> I plan to implement A soon if there are no objections.
>>>
>>> Unless someone somehow convinced me to do D, I'll also add an
>>> assertion in the Transaction.join method to raise an error if a
>>> data manager joins more than once.
>> Option A sounds sensible. It also means I won't have to change
>> anything in the zope.sqlalchemy data manager.
> 
> Very cool. I was hoping non-ZODB-data-manager authors
> were paying attention. :)
> 
> If anyone knows of any other, I would appreciate someone forwarding
> this thread to them.

zope.sendmail and MaildropHost have data managers.
I've seen some file-based things that was a data manager and a few 
others in people's BFG stacks, maybe they can pipe up and/or let the 
others of those wsgi components know.

I'm also likely about to write one, but I'm dumb, so can't comment 
meaningfully on the options ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk

___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Problem with handling of data managers that join transactions after savepoints

2010-05-10 Thread Jim Fulton
On Mon, May 10, 2010 at 5:22 PM, Laurence Rowe  wrote:
> On 10 May 2010 21:41, Jim Fulton  wrote:
>> A. Change transaction._transaction.AbortSavepoint to remove the
>>   datamanager from the transactions resources (joined data managers)
>>   when the savepoint is rolled back and abort called on the data
>>   manager. Then, if the data manager rejoins, it will have joined
>>   only once.
>>
>>   Update the documentation of the data manager abort method (in
>>   IDataManager) to say that abort is called either when a transaction
>>   is aborted or when rolling back to a savepoint created before the
>>   data manager joined, and that the data manager is no longer joined
>>   to the transaction after abort is called.
>>
>>   This is a backward incompatible change to the interface (because it
>>   weakens a precondition) that is unlikely to cause harm.
>
>> I plan to implement A soon if there are no objections.
>>
>> Unless someone somehow convinced me to do D, I'll also add an
>> assertion in the Transaction.join method to raise an error if a
>> data manager joins more than once.
>
> Option A sounds sensible. It also means I won't have to change
> anything in the zope.sqlalchemy data manager.

Very cool. I was hoping non-ZODB-data-manager authors
were paying attention. :)

If anyone knows of any other, I would appreciate someone forwarding
this thread to them.

Jim

-- 
Jim Fulton
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] Problem with handling of data managers that join transactions after savepoints

2010-05-10 Thread Laurence Rowe
On 10 May 2010 21:41, Jim Fulton  wrote:
> A. Change transaction._transaction.AbortSavepoint to remove the
>   datamanager from the transactions resources (joined data managers)
>   when the savepoint is rolled back and abort called on the data
>   manager. Then, if the data manager rejoins, it will have joined
>   only once.
>
>   Update the documentation of the data manager abort method (in
>   IDataManager) to say that abort is called either when a transaction
>   is aborted or when rolling back to a savepoint created before the
>   data manager joined, and that the data manager is no longer joined
>   to the transaction after abort is called.
>
>   This is a backward incompatible change to the interface (because it
>   weakens a precondition) that is unlikely to cause harm.

> I plan to implement A soon if there are no objections.
>
> Unless someone somehow convinced me to do D, I'll also add an
> assertion in the Transaction.join method to raise an error if a
> data manager joins more than once.

Option A sounds sensible. It also means I won't have to change
anything in the zope.sqlalchemy data manager.

Laurence
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev