nakagami / firebirdsql

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

Ping doesn't work as expected #82

Closed dimkouv closed 5 years ago

dimkouv commented 5 years ago

When the database gets stopped, connection.Ping() doesn't work as expected.

// Ping verifies a connection to the database is still alive,
// establishing a connection if necessary.
func (db *DB) Ping() error {

No error is returned and the connection isn't re-established if the database is started again.

Reproducing...

conn, err = sql.Open("firebirdsql", "connection/string/here")
for {
    fmt.Printf(">>> %v \n", conn.Ping())
    time.Sleep(2 * time.Second)
}
systemctl stop firebirdsql
sleep 5
systemctl start firebirdsql
bat22 commented 5 years ago

As i see, Ping() not implemented https://github.com/nakagami/firebirdsql/blob/master/driver_go18.go#L88