zodb Package

db Module

opennode.oms.zodb.db.get_db()[source]
opennode.oms.zodb.db.get_connection(accept_main_thread=False)[source]
opennode.oms.zodb.db.get_root(accept_main_thread=False)[source]
opennode.oms.zodb.db.transact(fun)[source]

Runs a callable inside a separate thread within a ZODB transaction.

Returned values are deeply copied. Currently only zodb objects returned directly or contained in the first level content of lists/sets/dicts are copied.

opennode.oms.zodb.db.ref(obj)[source]
opennode.oms.zodb.db.deref(obj_id)[source]

extractors Module

opennode.oms.zodb.extractors.context_from_method(fun, args, kwargs)[source]

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.

packer Module

class opennode.oms.zodb.packer.PackDaemonProcess[source]

Bases: opennode.oms.model.model.proc.DaemonProcess

pack(*args, **kwargs)[source]
run(*args, **kwargs)[source]

proxy Module

class opennode.oms.zodb.proxy.PersistentProxy(obj, context)[source]

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.

opennode.oms.zodb.proxy.make_persistent_proxy(res, context={})[source]

Table Of Contents

Previous topic

tools Package

Next topic

utils Package

This Page