scheduledcollectionaction.java
来自「人力资源管理系统 系统把几乎所有与人力资源相关的数据统一管理」· Java 代码 · 共 67 行
JAVA
67 行
//$Id: ScheduledCollectionAction.java,v 1.7.2.8 2003/12/27 07:16:00 oneovthafew Exp $package net.sf.hibernate.impl;import java.io.Serializable;import net.sf.hibernate.cache.CacheException;import net.sf.hibernate.cache.CacheConcurrencyStrategy.SoftLock;import net.sf.hibernate.collection.CollectionPersister;import net.sf.hibernate.engine.SessionImplementor;import net.sf.hibernate.impl.SessionImpl.Executable;abstract class ScheduledCollectionAction implements Executable { private final CollectionPersister persister; private final Serializable id; private final SessionImplementor session; private SoftLock lock; public ScheduledCollectionAction(CollectionPersister persister, Serializable id, SessionImplementor session) throws CacheException { this.persister = persister; this.session = session; this.id = id; } public void afterTransactionCompletion(boolean success) throws CacheException { if ( persister.hasCache() ) persister.getCache().release(id, lock); } public Serializable[] getPropertySpaces() { return new Serializable[] { persister.getCollectionSpace() }; } protected final CollectionPersister getPersister() { return persister; } protected final Serializable getId() { return id; } protected final SessionImplementor getSession() { return session; } public final void beforeExecutions() throws CacheException { // we need to obtain the lock before any actions are // executed, since this may be an inverse="true" // bidirectional association and it is one of the // earlier entity actions which actually updates // the database (this action is resposible for // second-level cache invalidation only) if ( persister.hasCache() ) lock = persister.getCache().lock(id); } protected final void evict() throws CacheException { if ( persister.hasCache() ) persister.getCache().evict(id); } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?