Interface
persistent.interfaces.IPersistent

Python persistent interface

A persistent object can be in one of several states:

In all the above, _p_oid (the persistent object id) is set when _p_jar first gets set.

The following state transitions are possible:

Note that there is a separate C API that is not included here. The C API requires a specific data layout and defines the sticky state.

About Invalidation, Deactivation and the Sticky & Ghost States

The sticky state is intended to be a short-lived state, to prevent an object's state from being discarded while we're in C routines. It is an error to invalidate an object in the sticky state.

Deactivation is a request that an object discard its state (become a ghost). Deactivation is an optimization, and a request to deactivate may be ignored. There are two equivalent ways to request deactivation:

There are two ways to invalidate an object: call the _p_invalidate() method (preferred) or delete its _p_changed attribute. This cannot be ignored, and is used when semantics require invalidation. Normally, an invalidated object transitions to the ghost state. However, some objects cannot be ghosts. When these objects are invalidated, they immediately reload their state from their data manager, and are then in the saved state.

Base interfaces

Attributes/Fields

* = required

Methods

Adapters

Adapters for objects providing this interface:

Specific Adapters

Extended Adapters

There are no extended adapters registered for this interface.

Generic Adapters

Views

Browser

Specific views

There are no views available.

Extended views

Generic views

XML-RPC

HTTP

FTP

Other

Other Information

Factories

A list of factories that create objects implementing this interface.

Classes

A list of classes that implement this interface. This might duplicate the entries in Utilities.