/** * Release the lock on the identified resource if it is held by the calling * thread. */ public synchronized void releaseLock(String lockName) { lockName = lockName.intern(); if (isLockOwner(lockName)) { if(getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' retuned by: " + Thread.currentThread().getName()); } getThreadLocks().remove(lockName); locks.remove(lockName); this.notifyAll(); } else if (getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' attempt to retun by: " + Thread.currentThread().getName() + " -- but not owner!", new Exception("stack-trace of wrongful returner")); } }
if (!isLockOwner(lockName)) { if(log.isDebugEnabled()) { log.debug( + Thread.currentThread().getName()); getThreadLocks().add(lockName); locks.add(lockName); } else if(log.isDebugEnabled()) {
getLog().info( "Using thread monitor-based data access locking (synchronization)."); setLockHandler(new SimpleSemaphore());
/** * Determine whether the calling thread owns a lock on the identified * resource. */ public synchronized boolean isLockOwner(String lockName) { lockName = lockName.intern(); return getThreadLocks().contains(lockName); }
getLog().info( "Using thread monitor-based data access locking (synchronization)."); setLockHandler(new SimpleSemaphore());
if (!isLockOwner(lockName)) { if(log.isDebugEnabled()) { log.debug( + Thread.currentThread().getName()); getThreadLocks().add(lockName); locks.add(lockName); } else if(log.isDebugEnabled()) {
/** * Determine whether the calling thread owns a lock on the identified * resource. */ public synchronized boolean isLockOwner(String lockName) { lockName = lockName.intern(); return getThreadLocks().contains(lockName); }
/** * Release the lock on the identified resource if it is held by the calling * thread. */ public synchronized void releaseLock(String lockName) { lockName = lockName.intern(); if (isLockOwner(lockName)) { if(getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' retuned by: " + Thread.currentThread().getName()); } getThreadLocks().remove(lockName); locks.remove(lockName); this.notifyAll(); } else if (getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' attempt to retun by: " + Thread.currentThread().getName() + " -- but not owner!", new Exception("stack-trace of wrongful returner")); } }
if (productName != null && productName.toLowerCase().contains("hsql")) { setUseDBLocks(false); setLockHandler(new SimpleSemaphore());
/** * Determine whether the calling thread owns a lock on the identified * resource. */ public synchronized boolean isLockOwner(Connection conn, String lockName) { lockName = lockName.intern(); return getThreadLocks().contains(lockName); }
/** * Release the lock on the identified resource if it is held by the calling * thread. */ public synchronized void releaseLock(Connection conn, String lockName) { lockName = lockName.intern(); if (isLockOwner(conn, lockName)) { if(getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' retuned by: " + Thread.currentThread().getName()); } getThreadLocks().remove(lockName); locks.remove(lockName); this.notifyAll(); } else if (getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' attempt to retun by: " + Thread.currentThread().getName() + " -- but not owner!", new Exception("stack-trace of wrongful returner")); } }
if (productName != null && productName.toLowerCase().contains("hsql")) { setUseDBLocks(false); setLockHandler(new SimpleSemaphore());
/** * Determine whether the calling thread owns a lock on the identified * resource. */ public synchronized boolean isLockOwner(Connection conn, String lockName) { lockName = lockName.intern(); return getThreadLocks().contains(lockName); }
/** * Release the lock on the identified resource if it is held by the calling * thread. */ public synchronized void releaseLock(Connection conn, String lockName) { lockName = lockName.intern(); if (isLockOwner(conn, lockName)) { if(getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' retuned by: " + Thread.currentThread().getName()); } getThreadLocks().remove(lockName); locks.remove(lockName); this.notifyAll(); } else if (getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' attempt to retun by: " + Thread.currentThread().getName() + " -- but not owner!", new Exception("stack-trace of wrongful returner")); } }
getLog().info( "Using thread monitor-based data access locking (synchronization)."); setLockHandler(new SimpleSemaphore());
Log log = getLog(); if (!isLockOwner(conn, lockName)) { if(log.isDebugEnabled()) { log.debug( + Thread.currentThread().getName()); getThreadLocks().add(lockName); locks.add(lockName); } else if(log.isDebugEnabled()) {
getLog().info( "Using thread monitor-based data access locking (synchronization)."); setLockHandler(new SimpleSemaphore());
Log log = getLog(); if (!isLockOwner(conn, lockName)) { if(log.isDebugEnabled()) { log.debug( + Thread.currentThread().getName()); getThreadLocks().add(lockName); locks.add(lockName); } else if(log.isDebugEnabled()) {
if (productName != null && productName.toLowerCase().contains("hsql")) { setUseDBLocks(false); setLockHandler(new SimpleSemaphore());
if (productName != null && productName.toLowerCase().contains("hsql")) { setUseDBLocks(false); setLockHandler(new SimpleSemaphore());