📄 scheduledcollectionaction.java
字号:
//$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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -