You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a PDOException (eg. duplicate key violation) happens during query executions, the DbConnection class automatically fails the transaction which cannot be reenabled in higher layers where the exception is handled, this way the whole transaction fails.
Proposal:
The caller should be able to examine if the process was in transaction. PDO provides a PDO::inTransaction call which can be wrapped, or the transactionCount property could be used.
The caller should be able to reenable the transaction, as the pair of the failTransaction() method.
OR
The top level caller should decide if to fail the transaction when catching an exception (classic commit/rollback style) not the query method, may break everything.
The text was updated successfully, but these errors were encountered:
When a PDOException (eg. duplicate key violation) happens during query executions, the DbConnection class automatically fails the transaction which cannot be reenabled in higher layers where the exception is handled, this way the whole transaction fails.
Proposal:
The caller should be able to examine if the process was in transaction. PDO provides a PDO::inTransaction call which can be wrapped, or the transactionCount property could be used.
The caller should be able to reenable the transaction, as the pair of the failTransaction() method.
OR
The top level caller should decide if to fail the transaction when catching an exception (classic commit/rollback style) not the query method, may break everything.
The text was updated successfully, but these errors were encountered: