EntityState
- STATUS_INITIALIZED ( -1 )This status indicates a new record that is not yet a candidate to insert into the database as no changes have yet occurred to its attributes, it's basically just empty.
- STATUS_NEW ( 0 )Says that at least one of the attributes of the EO has been updated ( attribute is AutoSubmit or a button is clicked then the validation will start) and thus the record is a candidate to be inserted to the database.
When you click "CreateInsert" button, the new record status is STATUS_INITIALIZED
When you set any attribute value, the entity's state transitions into NEW and will be added to the transaction.
When an entity row is created, modified, or removed, it is automatically enrolled in the transaction's list of pending changes.
The entity instance is added to the entity cache once the primary key is populated.
When you call commit() on the Transaction object, it processes its pending changes list, validating new or modified entity rows that might still be invalid.
When the entity rows in the pending list are all valid, the Transaction issues a database SAVEPOINT and coordinates saving the entity rows to the database.
If all goes successfully, it issues the final database COMMIT statement.
If anything fails, the Transaction performs a ROLLBACK TO SAVEPOINT to allow the user to fix the error and try again.
When the entity rows in the pending list are all valid, the Transaction issues a database SAVEPOINT and coordinates saving the entity rows to the database.
If all goes successfully, it issues the final database COMMIT statement.
If anything fails, the Transaction performs a ROLLBACK TO SAVEPOINT to allow the user to fix the error and try again.
The Transaction object used by an application module represents the working set of entity rows for a single end-user transaction.By design, it is not a shared, global cache.
The database engine itself is an extremely efficient shared, global cache for multiple, simultaneous users.
Setting row with status STATUS_INITIALIZED delay validation.
No comments:
Post a Comment