DATA-DOG / go-txdb

Immutable transaction isolated sql driver for golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

savepoint "tx_17" does not exist

samsondav opened this issue · comments

commented

I get this error running my test suite.

It can occur in different tests but it is always tx_17.

Is there some hardcoded limit for 16 savepoints somewhere?

Very likely it is the default database configuration limit. Check the db you are using

Also note, if you use the same DSN in every test to open tx-db and you do not close the database you opened, then you all of your tests may run within the same transaction. You should close the txdb on every test, in order to rollback the transaction.

I would also suggest to use different DSN in test because it would allow you to run those tests in parallel. But you always need to close the database in your tests since it rolls back the transaction