Beispiel #1
0
 public function test_getDbLock_shouldGetLock()
 {
     $db = Db::get();
     $this->assertTrue(Db::getDbLock('MyLock'));
     // same session still has lock
     $this->assertTrue(Db::getDbLock('MyLock'));
     Db::setDatabaseObject(null);
     // different session, should not be able to acquire lock
     $this->assertFalse(Db::getDbLock('MyLock', 1));
     // different session cannot release lock
     $this->assertFalse(Db::releaseDbLock('MyLock'));
     Db::destroyDatabaseObject();
     // release lock again by using previous session
     Db::setDatabaseObject($db);
     $this->assertTrue(Db::releaseDbLock('MyLock'));
     Db::destroyDatabaseObject();
 }
Beispiel #2
0
 protected function releaseArchiveTableLock($dbLockName)
 {
     Db::releaseDbLock($dbLockName);
 }
 protected function releaseArchiveProcessorLock()
 {
     $lockName = $this->getArchiveProcessorLockName();
     return Db::releaseDbLock($lockName);
 }
 protected function releaseArchiveTableLock()
 {
     $dbLockName = $this->getArchiveLockName();
     Db::releaseDbLock($dbLockName);
 }