Hitachi

uCosminexus Application Server Compatibility Guide


9.10 Optimistic lock

With Cosminexus JPA Provider, you use EntityManager and persistence context to manage the entities to be persisted. The changed entity information is applied to the database when the flush method or transaction commit processing is executed. When the same line of the database might be updated at the same time in multiple transactions, the data integrity must be ensured. Cosminexus JPA Provider provides the optimistic lock to ensure data integrity.

The optimistic lock is a lock functionality for making sure that the data is not updated by other applications from the beginning of the data update processing until the update processing is complete. The optimistic lock does not lock the database, and therefore, has the advantage that deadlocks do not occur.

This section describes the optimistic lock.

Organization of this section