public void lock(Object entity, LockModeType lockModeType, Map<String, Object> properties) {
LockOptions lockOptions = null;
try {
if ( !isTransactionInProgress() ) {
throw new TransactionRequiredException( "no transaction is in progress" );
}
//adjustFlushMode();
if ( !contains( entity ) ) {
throw new IllegalArgumentException( "entity not in the persistence context" );
}