-
Notifications
You must be signed in to change notification settings - Fork 18k
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
database/sql: Transaction commit closes the transaction even if there was an error on commit. #7777
Labels
Comments
CL https://golang.org/cl/89510043 mentions this issue. |
http://golang.org/pkg/database/sql/#Tx:A transaction must end with a call to Commit or Rollback. After a call to Commit or Rollback, all operations on the transaction fail with ErrTxDone. Status changed to WorkingAsIntended. |
If the commit fails in the driver, the underlying transaction in the database still exists. In Sqlite, you can not start a new transaction while one is already in progress so this effectively locks out the connection. I suppose you could execute a raw 'COMMIT' query to close this transaction but I find that idea to be quite silly. |
what do you mean? The code as it stands implements what the docs says about Tx, so this is not a bug. If you still think it's a bug, then you will need to address any dependencies on this rule before propose a change to it. In the CL discussion, lib/pq is said to depend on this assumption already, so it's very unlikely we want to change the behavior and break existing drivers. |
Thetawaves, Please provide small program to demonstrate "your problem". Tell us what your program does, and explain why it should behave differently. It is difficult to make a judgement without clear understanding the problem. Perhaps it is something driver should do. You need to convince everyone here that database/sql has to change. Thank you. Alex |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by Thetawaves:
The text was updated successfully, but these errors were encountered: