public UpdateTimestampsCache getUpdateTimestampsCache() { return getCurrentSessionFactoryImplementor().getUpdateTimestampsCache(); }
/** * Performs cleanup of any held cache softlocks. * * @param success Was the transaction successful. */ public void afterTransactionCompletion(boolean success) { int size = executions.size(); final boolean invalidateQueryCache = session.getFactory().getSettings().isQueryCacheEnabled(); for ( int i = 0; i < size; i++ ) { try { Executable exec = ( Executable ) executions.get(i); try { exec.afterTransactionCompletion( success ); } finally { if ( invalidateQueryCache ) { session.getFactory().getUpdateTimestampsCache().invalidate( exec.getPropertySpaces() ); } } } catch (CacheException ce) { log.error( "could not release a cache lock", ce ); // continue loop } catch (Exception e) { throw new AssertionFailure( "Exception releasing cache locks", e ); } } executions.clear(); }
public void execute(Executable executable) { final boolean lockQueryCache = session.getFactory().getSettings().isQueryCacheEnabled(); if ( executable.hasAfterTransactionCompletion() || lockQueryCache ) { executions.add( executable ); } if (lockQueryCache) { session.getFactory() .getUpdateTimestampsCache() .preinvalidate( executable.getPropertySpaces() ); } executable.execute(); }
/** * Performs cleanup of any held cache softlocks. * * @param success Was the transaction successful. */ public void afterTransactionCompletion(boolean success) { int size = executions.size(); final boolean invalidateQueryCache = session.getFactory().getSettings().isQueryCacheEnabled(); for ( int i = 0; i < size; i++ ) { try { Executable exec = ( Executable ) executions.get(i); try { exec.afterTransactionCompletion( success ); } finally { if ( invalidateQueryCache ) { session.getFactory().getUpdateTimestampsCache().invalidate( exec.getPropertySpaces() ); } } } catch (CacheException ce) { log.error( "could not release a cache lock", ce ); // continue loop } catch (Exception e) { throw new AssertionFailure( "Exception releasing cache locks", e ); } } executions.clear(); }
public void execute(Executable executable) { final boolean lockQueryCache = session.getFactory().getSettings().isQueryCacheEnabled(); if ( executable.hasAfterTransactionCompletion() || lockQueryCache ) { executions.add( executable ); } if (lockQueryCache) { session.getFactory() .getUpdateTimestampsCache() .preinvalidate( executable.getPropertySpaces() ); } executable.execute(); }
if ( factory.getUpdateTimestampsCache() != null ) { factory.getUpdateTimestampsCache() .invalidate( factory.getEntityPersister(entityName).getQuerySpaces() );