Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
The OpenAccess ORM Object Lifecycle
Programmer's Guide > OpenAccess ORM Classic (Old API) > Programming With OpenAccess > The OpenAccess ORM Object Lifecycle

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

Telerik OpenAccess ORM provides transparent persistence for your .NET applications. The data for application instances of persistent classes are automatically loaded from the database when fields of those instances are accessed. Once an instance is made persistent all its referenced objects are also made persistent, due to the persistence-by-reachability principle. Most operations on persistent classes are only allowed within the context of a transaction and it makes a difference whether an object instance refers to a persistent instance in the database or not. Unlike "normal" in-memory objects, instances of persistent classes have a defined state that depends on the current transaction context and whether there exists a corresponding instance in the database. The first two sections, Persistent New States and Persistent States, discuss these object states. Also, state-diagrams are presented that show which operations are allowed for objects in a particular object state and how these operations change the state. In fact, most of the time you will not have to care about the different object states at all. However, for a full understanding of how transparent persistence works and how to use OpenAccess ORM for manipulation of persistent instances, some knowledge about the object lifecycle is helpful.

You can have OpenAccess ORM call a user-defined method when certain lifecycle events occur. For example, your persistence capable classes can implement the OpenAccess ORM IInstanceCallbacks interface, which allows you to automatically perform operations on an object when it is read from the database. Using lifecycle events is described in the Lifecycle Events section.

Normally, all access to the data in a persistent class instance must be done within a transaction. However, in certain circumstances it is desirable to be able to access the object content outside of an active transaction. This topic is discussed in the Persistent Class Access Outside of a Transaction section.