Closed chakrapani123 closed 5 years ago
SetConnMaxLifetime sets the connection's maximum lifetime, not the connection timeout. The connection is a TCP one, through ODPI-C, which calls OCI, which uses the client-side sqlnet.ora file - see https://www.php.net/manual/en/function.oci-connect.php#84144
hello,
i ran into this bug with this driver and database/sql . i leverage this driver to do sql.open
//oracle is type oracle struct type Oracle struct { Driver string ConnectString string Db *sql.DB // logger log.Logger }
if err != nil { fmt.Println("error in db", err) return nil, err } mdb := m.Db mdb.SetConnMaxLifetime(time.Minute)
use-case:1 : correct connect string without any typo issues works fine
however use-case2: wrong port it waits till tnstimeout setting to error out . wondering if there is a way to make this fail faster than wait for it to timeout
also, is there a way to do reset connection for every new request?
thanks Chakri