Jakarta Persistence (JPA) Method
LockModeType getLockMode(
Object entity
)
Get the current lock mode held by this persistence context on the given managed entity instance.
- Parameters:
entity- a managed entity instance
- Returns:
- the lock mode currently held.
- Throws:
- if a transaction is active but the given instance is not a managed entity.IllegalArgumentException- if there is no active transaction or if the entity manager has not been joined to the current transaction.TransactionRequiredException
- Since:
- Jakarta Persistence (JPA) 2.0