What steps will reproduce the problem?
1. Open several connections to the same database, all running simultaneously
doing a simple transaction (e.g. Begin/Update/Commit), for instance run several
goroutines with GOMAXPROCS > 1
2. Some of these transaction will fail at the COMMIT step saying "database is
locked"
3. BEGIN a new TRANSACTION on a client which had the above error on COMMIT
What is the expected output? What do you see instead?
A new transaction should start, but instead this error is returned: "cannot
start a transaction within a transaction".
The database connection cannot get out of the current transaction and start a
new one.
The user of this library cannot work around this. SQLite3 wants the user to do
a ROLLBACK in order to start a new TRANSACTION, but database.sql.Tx considers
the entire transaction done once Commit() returned. Calling Rollback() after
Commit returned has no effect.
What version of the product are you using? On what operating system?
The latest source code (Jul 2014) on linux amd64.
Please provide any additional information below.
I've attached a short patch which solves this issue. If there was an error on
COMMIT, it performs a ROLLBACK before returning.
Original issue reported on code.google.com by MihaiBor...@gmail.com on 29 Jul 2014 at 7:12
Original issue reported on code.google.com by
MihaiBor...@gmail.com
on 29 Jul 2014 at 7:12Attachments: