How can you reduce the risk of a commit failure when modifying an object?
You are developing a multi-user application that commits transactions on an application server. In your application, there is a substantial risk of a commit failure due to the probability of two clients modifying the same object during overlapping time intervals.
Obtain a write lock on an object before modifying it.
You need to design your locking strategy carefully when obtaining multiple locks, so as not to lead to a deadlock situation where two separate processes are each waiting for a lock held by the other.
This solution reduces the probability of commit failure by assuring that the locking process is the only client to be making updates to an object.
Check Out Objects provides a way to "lock" an object for a long period of time, so that the lock may be maintained across transactions and outside of transactions for an indefinite amount of time.
Replay Changes can be used when the probability of commit failure is relatively low.