yapep_base icon indicating copy to clipboard operation
yapep_base copied to clipboard

DbConnection class should provide a feature to enable a transaction

Open emulgeator opened this issue 9 years ago • 0 comments

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.

emulgeator avatar May 24 '15 16:05 emulgeator