Closed mukexa closed 6 years ago
This problem is repeated if you use transactions
package main
import (
"database/sql"
"fmt"
_ "github.com/nakagami/firebirdsql"
)
func main() {
var n int
conn, _ := sql.Open("firebirdsql", "sysdba:masterkey@localhost/test")
tx, _ := conn.Begin()
err := tx.QueryRow("SELECT Count(*) FROM rdb$relations").Scan(&n)
if err != nil {
tx.Rollback()
fmt.Println("TX:", err)
}
fmt.Println("Relations count=", n)
tx.Commit()
err = conn.Close()
if err != nil {
fmt.Println(err)
}
}
Relations count= 42 cannot disconnect database with open transactions (1 active)
Oh, sorry
I have fixed it. Still something wrong ?
return