nakagami / firebirdsql

Firebird RDBMS sql driver for Go (golang)
MIT License
227 stars 60 forks source link

Transactions automatic commit/begin wrong #42

Closed michael88 closed 6 years ago

michael88 commented 7 years ago

system begins automatic Transactions, even if an automatically created transaction is active.

  1. connect to Database -> System starts automatically a Transaction (TRANS 1)
  2. User explicitly starts Transaction(TRANS 2), do something and commit Transaction -> System starts automatically Transaction (TRANS 3)
  3. User explicitl starts Transaction(Trans 4), do something and commit Transaction -> System starts a automatically Transaction (Trans 5)

Now there are three open Transactions (1 , 3, 5)

ghost commented 6 years ago

I can confirm this as well... Almost all transactions remain opened until I close the database, even using manual "commit"... BTW, Firebird opens a transaction for every operation, even for a simple select, so u have to commit everything u do. But, I just saw in the source code that the "autocommit" flag is just inside the "execute" statment. I would suggest to put "autocommit" in "query" and "query row" as well

To test this, just need to use this query : " SELECT * FOM MON$TRANSACTIONS; "

nakagami commented 6 years ago

related issue #67