https://lab.civicrm.org/dev/core/-/issues/3988
$query = "SELECT RELEASE_LOCK( %1 )";
$params = [1 => [$this->_id, 'String']];
- return CRM_Core_DAO::singleValueQuery($query, $params);
+ if (CRM_Core_Transaction::isActive()) {
+ CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, function () {
+ return CRM_Core_DAO::singleValueQuery($query, $params);
+ });
+ }
+ else {
+ return CRM_Core_DAO::singleValueQuery($query, $params);
+ }
}
}