lock mode held by this persistence context on the given managed entity instance.">
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:
IllegalArgumentException - if a transaction is active but the given instance is not a managed entity.
TransactionRequiredException - if there is no active transaction or if the entity manager has not been joined to the current transaction.
Since:
Jakarta Persistence (JPA) 2.0