Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DbConnection class should provide a feature to enable a transaction #12

Open
emulgeator opened this issue May 24, 2015 · 0 comments
Open
Milestone

Comments

@emulgeator
Copy link
Collaborator

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 emulgeator modified the milestone: v0.4.0 May 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant