Entity State Management

The object state APIs provide methods for returning information about entities in the database. All entities that support pending state have the following attributes:

Name C# Type Description
IsNew bool Returns true if this entity is new (but has not been created in the client database).
IsCreated bool Returns true if this entity has been newly created in the client database, and one the following is true:
  • The entity has not yet been submitted to the server with a replay request.
  • The entity has been submitted to the server, but the server has not finished processing the request.
  • The server rejected the replay request (replayFailure message received).
IsDirty bool Returns true if this entity has been changed in memory, but the change has not yet been saved to the client database.
IsDeleted bool Returns true if this entity was loaded from the database and was subsequently deleted.
IsUpdated bool Returns true if this entity has been updated or changed in the database, and one of the following is true:
  • The entity has not yet been submitted to the server with a replay request.
  • The entity has been submitted to the server, but the server has not finished processing the request.
  • The server rejected the replay request (replayFailure message received).
Pending bool Returns true for any row that represents a pending create, update, or delete operation, or a row that has cascading children with a pending operation.
PendingChange char If pending is true, then 'C' (create), 'U' (update), 'D' (delete), 'P' (to indicate that this MBO is a parent in a cascading relationship for one or more pending child objects, but this MBO itself has no pending create, update or delete operations). If pending is false, then 'N'.
ReplayCounter long Returns a long value which is updated each time a row is created or modified by the client. This value is derived from the time in seconds since an epoch, and increases each time a row is changed.
ReplayPending long Returns a long value. When a pending row is submitted to the server, the value of ReplayCounter is copied to ReplayPending. This allows the client code to detect if a row has been changed since it was submitted to the server (that is, if the value of ReplayCounter is greater than ReplayPending).
ReplayFailure long Returns a long value. When the server responds with a ReplayFailure message for a row that was submitted to the server, the value of ReplayCounter is copied to ReplayFailure, and ReplayPending is set to 0.