try { $sql = 'SELECT pg_try_advisory_lock(:key)';
$result =
$this->conn->
executeQuery($sql,
[ 'key' =>
$this->
getHashedKey($key),
]);
// Check if lock is acquired
if (true ===
$result->
fetchOne()) { $key->
markUnserializable();
// release sharedLock in case of promotion
$this->
unlockShared($key);
$lockAcquired = true;
return;
} } finally { if (!
$lockAcquired) { $this->
getInternalStore()->
delete($key);
} }