Saturday, February 2, 2013

Lifecycle of an Entity Object in ADF


This is an extract taken from book Oracle ADF Real World Developer's Guide.

When you create an instance of an entity object by using the createInstance2(DBTransaction, AttributeList) method on the entity definition, its state is New. Entity objects in the New state will qualify in order to participate in the transaction.

When a client invokes finder methods on an entity definition or on an entity based view object, the framework creates entity rows for each row from the database. The state of these entity rows will be marked as Unmodified. Later when the client modifies some attributes, the state is transitioned to Modified and they become eligible to participate in the transaction.

When a client calls the remove method on an entity object, entity state becomes Deleted and it will be added to the transaction cycle.

The transaction commit cycle takes place in two phases, posting changes to the database and then committing the database transaction. On successful commit to the database, all the entities in the state New and Modified will be transitioned to Unmodified, and Deleted entity rows will be transitioned to the Dead state.


No comments:

Post a Comment