up
This commit is contained in:
@@ -110,7 +110,15 @@ class Database {
|
||||
}
|
||||
|
||||
public function rollback() {
|
||||
return $this->pdo->rollback();
|
||||
try {
|
||||
return $this->pdo->rollback();
|
||||
} catch (PDOException $e) {
|
||||
// Si no hay transacción activa, simplemente ignorar
|
||||
if ($e->getCode() !== 'HY000' || strpos($e->getMessage(), 'no active transaction') === false) {
|
||||
throw $e;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function execute($sql, $params = []) {
|
||||
|
||||
Reference in New Issue
Block a user