Christian Theune writes:
 > I have a zope product, that uses threads, to control programs
 > running outside zope and doing some async stuff.
 > What I found is, that i can't do changes from the self-started
 > thread (ChrisW: that's the problem... ;) ).
 > But how do I get into a transaction do be able to change things on
 > persistent objects?
You need a ZODB connection in order to be able to change objects
in the ZODB.

You get one (in your new thread!) by 

    from Zope import app

    root= app() # the ZODB root object but without 'RequestContainer'

You can now build a new REQUEST object and use "BaseRequest.traverse"
to reach the object you want (identified by an URL).

Before you change anything, you need to begin a transaction
and finally either commit or abort it.


Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to