/** * Return the concurrency manager. */ public ConcurrencyManager getMutex() { if (mutex == null) { synchronized (this) { if (mutex == null) { mutex = new ConcurrencyManager(this); } } } return mutex; }
/** * Acquire the lock on the cache key object. For the merge process * called with true from the merge process, if true then the refresh will not refresh the object */ public void acquire(boolean forMerge) { if (this.isIsolated) { this.depth++; return; } super.acquire(forMerge); }
/** * Check the lock state, if locked, acquire and release a deferred lock. * This optimizes out the normal deferred-lock check if not locked. */ public void checkDeferredLock() throws ConcurrencyException { // If it is not locked, then just return. if (this.activeThread == null) { return; } acquireDeferredLock(); releaseDeferredLock(); }
/** * Check the lock state, if locked, acquire and release a read lock. * This optimizes out the normal read-lock check if not locked. */ public void checkReadLock() throws ConcurrencyException { // If it is not locked, then just return. if (this.activeThread == null) { return; } acquireReadLock(); releaseReadLock(); }
DeferredLockManager lockManager = getDeferredLockManager(currentThread); if (lockManager == null) { lockManager = new DeferredLockManager(); putDeferredLock(currentThread, lockManager); if ((this.activeThread == currentThread) || (!isAcquired())) { lockManager.addActiveLock(this); acquire(); } else { lockManager.addDeferredLock(this); if (AbstractSessionLog.getLog().shouldLog(SessionLog.FINER)) { AbstractSessionLog.getLog().log(SessionLog.FINER, "acquiring_deferred_lock", getOwnerCacheKey().getObject(), currentThread.getName());
if (!mutex.isAcquired()) { beginExternalTransaction(); mutex.setActiveThread(Thread.currentThread()); mutex.acquire(); if (!mutex.isNested()) { if (this.eventManager != null) { this.eventManager.preBeginTransaction();
getTransactionMutex().setActiveThread(Thread.currentThread()); getTransactionMutex().acquire(); if (!getTransactionMutex().isNested()) { if (this.eventManager != null) { this.eventManager.preBeginTransaction();
/** * Acquire a lock for the sequence name. * A lock should be, and only be, acquired when allocating new sequences from the database. */ protected void acquireLock(String sequenceName) { ConcurrencyManager manager = getLocks().get(sequenceName); if (manager == null) { synchronized (getLocks()) { manager = getLocks().get(sequenceName); if (manager == null) { manager = new ConcurrencyManager(); getLocks().put(sequenceName, manager); } } } manager.acquire(); }
/** * Acquire the lock on the cache key object. But only if the object has no lock on it * Added for CR 2317 * called with true from the merge process, if true then the refresh will not refresh the object */ public boolean acquireNoWait(boolean forMerge) { if (this.isIsolated) { this.depth++; return true; } return super.acquireNoWait(forMerge); }
/** * Acquire the read lock on the cache key object. */ public void acquireReadLock() { if (this.isIsolated) { return; } super.acquireReadLock(); }
this.deployLock.acquire(); isLockAcquired = true; if (this.state == STATE_PREDEPLOYED) { this.deployLock.release(); isLockAcquired = false; if (this.state == STATE_DEPLOY_FAILED) { this.deployLock.acquire(); isLockAcquired = true; this.deployLock.release(); isLockAcquired = false; this.deployLock.release();
/** * Acquire the read lock on the cache key object. Return true if acquired. */ public boolean acquireReadLockNoWait() { if (this.isIsolated) { return true; } return super.acquireReadLockNoWait(); }
/** * Acquire the lock on the cache key object. But only if the object has no lock on it * Added for CR 2317 * called with true from the merge process, if true then the refresh will not refresh the object */ public boolean acquireWithWait(boolean forMerge, int wait) { if (this.isIsolated) { this.depth++; return true; } return super.acquireWithWait(forMerge, wait); }
/** * Check the deferred lock on the cache key object. * This can be called to ensure the cache key has a valid built object. * It does not hold a lock, so the object could be refreshed afterwards. */ public void checkDeferredLock() { if (this.isIsolated) { return; } super.checkDeferredLock(); }
/** * Check the read lock on the cache key object. * This can be called to ensure the cache key has a valid built object. * It does not hold a lock, so the object could be refreshed afterwards. */ public void checkReadLock() { if (this.isIsolated) { return; } super.checkReadLock(); }
/** * Acquire the deferred lock. */ public void acquireDeferredLock() { if (this.isIsolated) { this.depth++; return; } super.acquireDeferredLock(); }
/** * Acquire the lock on the cache key object. Only acquire a lock if the cache key's * active thread is not set. * Added for Bug 5840635 */ public boolean acquireIfUnownedNoWait() { if (this.isIsolated) { if (this.depth > 0) { return false; } this.depth++; return true; } return super.acquireIfUnownedNoWait(false); }
DeferredLockManager lockManager = getDeferredLockManager(currentThread); if (lockManager == null) { lockManager = new DeferredLockManager(); putDeferredLock(currentThread, lockManager); if ((this.activeThread == currentThread) || (!isAcquired())) { lockManager.addActiveLock(this); acquire(); } else { lockManager.addDeferredLock(this);
if (!mutex.isAcquired()) { beginExternalTransaction(); mutex.setActiveThread(Thread.currentThread()); mutex.acquire(); if (!mutex.isNested()) { if (this.eventManager != null) { this.eventManager.preBeginTransaction();
/** * Check the lock state, if locked, acquire and release a read lock. * This optimizes out the normal read-lock check if not locked. */ public void checkReadLock() throws ConcurrencyException { // If it is not locked, then just return. if (this.activeThread == null) { return; } acquireReadLock(); releaseReadLock(); }