}
@Override
public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session) {
if ( !lockable.isVersioned() ) {
throw new OptimisticLockException( object, "[" + lockMode + "] not supported for non-versioned entities [" + lockable.getEntityName() + "]" );
}
EntityEntry entry = session.getPersistenceContext().getEntry(object);
EventSource source = (EventSource)session;
EntityVerifyVersionProcess verifyVersion = new EntityVerifyVersionProcess(object, entry);
// Register the EntityVerifyVersionProcess action to run just prior to transaction commit.