本文整理了Java中org.hibernate.engine.spi.SessionFactoryImplementor.getUpdateTimestampsCache()
方法的一些代码示例,展示了SessionFactoryImplementor.getUpdateTimestampsCache()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SessionFactoryImplementor.getUpdateTimestampsCache()
方法的具体详情如下:
包路径:org.hibernate.engine.spi.SessionFactoryImplementor
类名称:SessionFactoryImplementor
方法名:getUpdateTimestampsCache
[英]Get the cache of table update timestamps
[中]获取表更新时间戳的缓存
代码示例来源:origin: BroadleafCommerce/BroadleafCommerce
/**
*
* @param em
* @param entityType
* @param ids
*/
public static void executeTargetedCacheInvalidation(EntityManager em, Class<?> entityType, List<Long> ids) {
Session session = em.unwrap(Session.class);
for (Long id : ids) {
session.getSessionFactory().getCache().evictEntity(entityType, id);
}
//update the timestamp cache for the table so that queries will be refreshed
ClassMetadata metadata = session.getSessionFactory().getClassMetadata(entityType);
String tableName = ((AbstractEntityPersister) metadata).getTableName();
UpdateTimestampsCache timestampsCache = em.unwrap(SessionImplementor.class).getFactory().getUpdateTimestampsCache();
if (timestampsCache != null) {
timestampsCache.invalidate(new Serializable[]{tableName});
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
public void afterTransactionCompletion(boolean success) {
for ( AfterTransactionCompletionProcess process : processes ) {
try {
process.doAfterTransactionCompletion( success, session );
}
catch ( CacheException ce ) {
LOG.unableToReleaseCacheLock( ce );
// continue loop
}
catch ( Exception e ) {
throw new AssertionFailure( "Exception releasing cache locks", e );
}
}
processes.clear();
if ( session.getFactory().getSettings().isQueryCacheEnabled() ) {
session.getFactory().getUpdateTimestampsCache().invalidate(
querySpacesToInvalidate.toArray( new String[ querySpacesToInvalidate.size()] )
);
}
querySpacesToInvalidate.clear();
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
public void afterTransactionCompletion(boolean success) {
for ( AfterTransactionCompletionProcess process : processes ) {
try {
process.doAfterTransactionCompletion( success, session );
}
catch ( CacheException ce ) {
LOG.unableToReleaseCacheLock( ce );
// continue loop
}
catch ( Exception e ) {
throw new AssertionFailure( "Exception releasing cache locks", e );
}
}
processes.clear();
if ( session.getFactory().getSettings().isQueryCacheEnabled() ) {
session.getFactory().getUpdateTimestampsCache().invalidate(
querySpacesToInvalidate.toArray( new String[ querySpacesToInvalidate.size()] )
);
}
querySpacesToInvalidate.clear();
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
private void registerCleanupActions(Executable executable) {
beforeTransactionProcesses.register( executable.getBeforeTransactionCompletionProcess() );
if ( session.getFactory().getSettings().isQueryCacheEnabled() ) {
final String[] spaces = (String[]) executable.getPropertySpaces();
if ( spaces != null && spaces.length > 0 ) { //HHH-6286
afterTransactionProcesses.addSpacesToInvalidate( spaces );
session.getFactory().getUpdateTimestampsCache().preinvalidate( spaces );
}
}
afterTransactionProcesses.register( executable.getAfterTransactionCompletionProcess() );
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
private void registerCleanupActions(Executable executable) {
beforeTransactionProcesses.register( executable.getBeforeTransactionCompletionProcess() );
if ( session.getFactory().getSettings().isQueryCacheEnabled() ) {
final String[] spaces = (String[]) executable.getPropertySpaces();
if ( spaces != null && spaces.length > 0 ) { //HHH-6286
afterTransactionProcesses.addSpacesToInvalidate( spaces );
session.getFactory().getUpdateTimestampsCache().preinvalidate( spaces );
}
}
afterTransactionProcesses.register( executable.getAfterTransactionCompletionProcess() );
}
内容来源于网络,如有侵权,请联系作者删除!