}
@Override
public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session)
throws StaleObjectStateException, JDBCException {
AdvancedCache advCache = getProvider(session).getCache(ENTITY_STORE).getAdvancedCache();
EntityKey key = EntityKeyBuilder.fromData(
lockable.getRootTableName(),
lockable.getRootTableIdentifierColumnNames(),
identifierGridType,
id,
session );
advCache.lock( key );
//FIXME check the version number as well and raise an optimistic lock exception if there is an issue JPA 2 spec: 3.4.4.2
}