Search in sources :

Example 1 with SoftLockItemProcessor

use of com.oracle.coherence.hibernate.cache.v53.access.processor.SoftLockItemProcessor in project coherence-hibernate by coherence-community.

the class AbstractReadWriteCoherenceEntityDataAccess method lockItem.

/**
 * {@inheritDoc}
 */
@Override
public org.hibernate.cache.spi.access.SoftLock lockItem(SharedSessionContractImplementor session, Object key, Object version) throws CacheException {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("lockItem({}, {})", key, version);
    }
    CoherenceRegionValue valueIfAbsent = newCacheValue(null, version);
    CoherenceRegionValue.SoftLock newSoftLock = newSoftLock();
    SoftLockItemProcessor processor = new SoftLockItemProcessor(valueIfAbsent, newSoftLock);
    getCoherenceRegion().invoke(key, processor);
    return newSoftLock;
}
Also used : CoherenceRegionValue(com.oracle.coherence.hibernate.cache.v53.region.CoherenceRegionValue) SoftLockItemProcessor(com.oracle.coherence.hibernate.cache.v53.access.processor.SoftLockItemProcessor)

Aggregations

SoftLockItemProcessor (com.oracle.coherence.hibernate.cache.v53.access.processor.SoftLockItemProcessor)1 CoherenceRegionValue (com.oracle.coherence.hibernate.cache.v53.region.CoherenceRegionValue)1