OptimisticLocking assumes you will be the only one changing the target. If there is a transaction conflict, the conflict could be resolved in one of several ways:
Here is the definition I've always heard for OptimisticLocking (versus PessimisticLocking):
OptimisticLocking resolves change conflicts at the very last moment. It accomplishes this by comparing the "Load Set" of each participant with the "Store Set" of that participant. The "Load Set" enumerates the specific records that the transaction in question has read and the most recent time that they were read. The "Store Set" enumerates the specific records that the transaction in question has written (or changed, depending on the system) and when they were modified. The transaction commit then proceeds as follows, for each entry in the store set:
The effect of this is to delay locking to the last possible moment. The choice between OptimisticLocking and PessimisticLocking (and there are some other intermediate approaches) includes the following considerations: