JPA Method
in jakarta.persistence.EntityManager

LockModeType getLockMode(
  Object entity
)


Get the current plain held by this persistence context on the given managed entity instance.
Parameters:
entity - a managed entity instance
Return:
the lock mode currently held
Throws:
TransactionRequiredException - if there is no active transaction or if the entity manager has not been joined to the current transaction
IllegalArgumentException - if a transaction is active but the given instance is not a managed entity
Since:
JPA 2.0