rana/ora

Ping returns error ORA-01010: invalid OCI operation

Closed this issue · 4 comments

When calling db.Ping() it returns error

Ses.Ping Env.ociError ORA-01010: invalid OCI operation

go version go1.9.1 linux/amd64
oracle client lib 11.2
Server _O_VERSION Oracle9i Release 9.2.0.8.0 - 64bit Production JServer Release 9.2.0.8.0 - Production

I ques it's the (quite old) server which causes the error but it would be nice if it would be possible to change the driver so that it would work with this old version too. Other basic operations (using DML statements) seem to work...

Why do you need the ping?

Do you know which version has appeared the Ping support in first?

cjbj commented

@tgulacsi you can treat ORA-1010 as a successful ping: https://github.com/php/php-src/blob/PHP-7.1.10/ext/oci8/oci8.c#L2091-L2094 (and yes, ODPI-C needs this change too)

@cjbj that's what I've thought, too: checking Version of server for every Ping is a big unnecessary overhead, storing this info on the Srv object is a big unnecessary complexity overhead.

I used ping as it seems to be recommended by the go's DB interface, see quote from the doc of the db.Open:

Open may just validate its arguments without creating a connection to the database. To verify that the data source name is valid, call Ping.