protected function acquireLock($name, $timeout = 0)
{
$lockStatus = null;
/** clean vars before using */
$releaseOnCommit = $this->releaseOnCommit ? 'TRUE' : 'FALSE';
$timeout = abs((int) $timeout);
/** inside pl/sql scopes pdo binding not working correctly :( */
$this->db->createCommand('DECLARE
handle VARCHAR2(128);
BEGIN
DBMS_LOCK.ALLOCATE_UNIQUE(:name, handle);
:lockStatus := DBMS_LOCK.REQUEST(handle, DBMS_LOCK.' . $this->lockMode . ', ' . $timeout . ', ' . $releaseOnCommit . ');
END;', [':name' => $name])->bindParam(':lockStatus', $lockStatus, PDO::PARAM_INT, 1)->execute();
return $lockStatus === 0 || $lockStatus === '0';
}