DATA-DOG / go-txdb

Immutable transaction isolated sql driver for golang
Other
667 stars 48 forks source link

savepoint "tx_17" does not exist #31

Closed samsondav closed 4 years ago

samsondav commented 4 years ago

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?

l3pp4rd commented 4 years ago

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

l3pp4rd commented 4 years ago

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