On Wed, Nov 22, 2006 at 08:12:45AM +1100, Tom Dossis wrote:
> Thierry Florac wrote:
> > 
> > But now I have to face another problem : tasks are executed outside of
> > any request or context environment ; because of this, components lookups
> > always fail !
> > So I'd like to know :
> >  - how can I handle transactions ?
> 
> I expect the normal explicit transaction calls to work, but not that
> I've used the scheduler myself:
> 
>   import transaction
>   transaction.commit()
> or
>   transaction.abort()

I used this pattern when working with the scheduler:

    transaction.begin()
    try:
        ...
        transaction.commit()
    except:
        transaction.abort()
        raise

Not sure if it's exactly correct though.

-- 
Brian Sutherland

Metropolis - "it's the first movie with a robot. And she's a woman.
              And she's EVIL!!"
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to