Currently works only for methods by assuming that the first argument is self. Unfortunately we cannot know the dynamic binding for the method because the @transact decorator is invoked at class definition time.
If self is already a persistent object with a context attached, then that context is returned, otherwise it searches for matching IContextExtractor subscription adpaters.
Bases: object
This is a proxy object which tracks attribute acces when the persistent object is outsite a living transaction (e.g. when returned from a db.transact deferred). The access will cause an exception if it’s done in the main thread. Access done in a zodb thread will cause the object to be reloaded in the current transaction.