Public Methods

  Name Description
Public method AddPendingAction Adds the specified pending action to this object's PendingActions collection.
Note
You probably won't directly manipulate an object's pending actions in this manner. You will more likely call wrapper methods such as Delete and Checkin, which add a pending action to the collection.)
Public method ClearPendingActions Clears out the list of pending actions for this object. For example, if you called Delete() without subsequently calling Save, then called ClearPendingActions(), the Delete pending action would no longer be in the object's pending actions list. This effectively cancels changes not yet saved.
Public method Delete Adds a Delete pending action to this object's PendingActions collection. You must subsequently commit the change to the repository. (See PendingAction for more information about pending actions.)
Public method GetAccessAllowed Returns a value representing a bit mask of access rights granted to the user requesting this object.
Public method GetPendingActions Returns the pending actions for this object.
Public method GetUpdateSequenceNumber Returns the update sequence number (USN) for this object.

You can use the returned value to determine if the object has been modified since some earlier fetch of the same object.

An IndependentlyPersistableObject has an update sequence number (USN), which is an Integer value on the object that protects it against concurrent updates. The USN value increases monotonically with each update to the object. When you update the object, the USN from the retrieved object is checked against the currently persisted USN value. If the values are different, the operation fails.

As a special case, a USN value of Null causes the server-side check to be skipped during updates (this is sometimes called "unprotected update"). An IndependentlyPersistableObject instantiated by calling one of the GetInstance methods on a Factory class (such as Factory.CustomObject.GetInstance) does not fetch the object from the server, and therefore, is unaware of the persisted USN. Calling GetUpdateSequence on such an object returns Null.

Public method IsCurrent Returns a value indicating whether or not the state of this object is consistent with its state in the repository.

When one or more of the object's properties are "dirty" (have been marked as changed since the last time they were saved), IsCurrent returns False. You can then do one of the following:

  • Save changes to the persistent store. (You can either call the Save method or add the object to an UpdatingBatch then call UpdateBatch, which effectively calls Save on each IndependentlyPersistableObject in the batch.)
  • Call the object's Refresh method to cancel the changes and restore the object's state to that of the persistent store.
  • Remove dirty properties by calling RemoveFromCache.
Public method Save Overloaded. Saves changes made to this object. You can optionally refresh all of the object's properties.
Public method SetUpdateSequenceNumber Sets the update sequence number (USN) for this object. You can cause update sequence checking to be skipped for this object by setting the USN value to Null.
Top

See Also