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
Why do you begin a transaction in your commit method?! #6258
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Ah actually, the second code block is in |
And to answer your question, this is done in auto-commit mode: https://www.doctrine-project.org/projects/doctrine-dbal/en/3.7/reference/transactions.html#auto-commit-mode The new transaction is not nested, since we are inside |
cod done? |
Bug Report
Using Doctrine 3.7.2 and Symfony 6.3.
Summary
In the EntityManager.php file, we have the
wrapInTransaction
method:https://github.com/doctrine/orm/blob/e585a92763612455f591b44cf0482d9852cc5fc0/lib/Doctrine/ORM/EntityManager.php#L267-L284
Inside the code of
$this->conn->commit()
we can find that at the very end of the method:dbal/src/Connection.php
Lines 1442 to 1448 in 6a793fb
Why to declare a nested transaction at the end without ever closing it?
Current behaviour
I noticed that when I run my integration tests, warning about "Nested Transactions..."
I was "forced" to declare "use_savepoints: true" in my doctrine.yaml.
How to reproduce
Don't declare use_savepoints: true in doctrine.yaml and run an integration test using
wrapInTransaction
.Expected behaviour
Don't declare a useless nested transaction.
The text was updated successfully, but these errors were encountered: