Re: [Zope-dev] transaction_manager attribute of transaction.interfaces.IDataManager

2010-06-08 Thread Jim Fulton
On Tue, Jun 8, 2010 at 6:23 AM, Laurence Rowe  wrote:
> On 8 June 2010 09:45, Chris Withers  wrote:
>> Hi All,
>>
>> What is this attribute actually used for?
>>
>> I see it present on IDataManager but I notice that zope.sqlalchemy's
>> SessionDataManager doesn't have this attribute, with no apparent ill effect.
>
>    transaction_manager = zope.interface.Attribute(
>        """The transaction manager (TM) used by this data manager.
>
>        This is a public attribute, intended for read-only use.  The value
>        is an instance of ITransactionManager, typically set by the data
>        manager's constructor.
>        """)
>
> This seems to be used only in the tests, I guess it would be useful if
> you were using multiple transaction managers in a single thread. I've
> now added it to zope.sqlalchemy's data manager.

I'm in favor of removing it from the interface.

Jim

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


Re: [Zope-dev] transaction_manager attribute of transaction.interfaces.IDataManager

2010-06-08 Thread Chris Withers
Laurence Rowe wrote:
> On 8 June 2010 11:25, Chris Withers  wrote:
>> Laurence Rowe wrote:
>>>transaction_manager = zope.interface.Attribute(
>>>"""The transaction manager (TM) used by this data manager.
>>>
>>>This is a public attribute, intended for read-only use.  The value
>>>is an instance of ITransactionManager, typically set by the data
>>>manager's constructor.
>>>""")
>>>
>>> This seems to be used only in the tests, I guess it would be useful if
>>> you were using multiple transaction managers in a single thread.
>> Can you think fo examples where that would happen?
> 
> Perhaps if you wanted to use an event based (as opposed to threaded) server.

Yes, annoyingly that's exactly what I'm doing ;-)

I need to manage transactions in a twisted application, so I guess I 
can't just do:

import transaction
transaction.get()

:-(

I don't suppose anyone has examples of using the transaction package in 
an asyncronous, event-based environment?

cheers,

Chris

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


Re: [Zope-dev] transaction_manager attribute of transaction.interfaces.IDataManager

2010-06-08 Thread Laurence Rowe
On 8 June 2010 11:25, Chris Withers  wrote:
> Laurence Rowe wrote:
>>
>>    transaction_manager = zope.interface.Attribute(
>>        """The transaction manager (TM) used by this data manager.
>>
>>        This is a public attribute, intended for read-only use.  The value
>>        is an instance of ITransactionManager, typically set by the data
>>        manager's constructor.
>>        """)
>>
>> This seems to be used only in the tests, I guess it would be useful if
>> you were using multiple transaction managers in a single thread.
>
> Can you think fo examples where that would happen?

Perhaps if you wanted to use an event based (as opposed to threaded) server.

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


Re: [Zope-dev] transaction_manager attribute of transaction.interfaces.IDataManager

2010-06-08 Thread Wichert Akkerman
On 6/8/10 12:25 , Chris Withers wrote:
> Laurence Rowe wrote:
>>  transaction_manager = zope.interface.Attribute(
>>  """The transaction manager (TM) used by this data manager.
>>
>>  This is a public attribute, intended for read-only use.  The value
>>  is an instance of ITransactionManager, typically set by the data
>>  manager's constructor.
>>  """)
>>
>> This seems to be used only in the tests, I guess it would be useful if
>> you were using multiple transaction managers in a single thread.
>
> Can you think fo examples where that would happen?
>
> What is a "transaction manager"?

See transaction.interfaces.ITransactionManager

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


Re: [Zope-dev] transaction_manager attribute of transaction.interfaces.IDataManager

2010-06-08 Thread Chris Withers
Laurence Rowe wrote:
> transaction_manager = zope.interface.Attribute(
> """The transaction manager (TM) used by this data manager.
> 
> This is a public attribute, intended for read-only use.  The value
> is an instance of ITransactionManager, typically set by the data
> manager's constructor.
> """)
> 
> This seems to be used only in the tests, I guess it would be useful if
> you were using multiple transaction managers in a single thread. 

Can you think fo examples where that would happen?

What is a "transaction manager"?

cheers,

Chris

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


Re: [Zope-dev] transaction_manager attribute of transaction.interfaces.IDataManager

2010-06-08 Thread Laurence Rowe
On 8 June 2010 09:45, Chris Withers  wrote:
> Hi All,
>
> What is this attribute actually used for?
>
> I see it present on IDataManager but I notice that zope.sqlalchemy's
> SessionDataManager doesn't have this attribute, with no apparent ill effect.

transaction_manager = zope.interface.Attribute(
"""The transaction manager (TM) used by this data manager.

This is a public attribute, intended for read-only use.  The value
is an instance of ITransactionManager, typically set by the data
manager's constructor.
""")

This seems to be used only in the tests, I guess it would be useful if
you were using multiple transaction managers in a single thread. I've
now added it to zope.sqlalchemy's data manager.

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