K2InformaticsGmbH / erloci

Erlang Oracle native driver - DEPRECATED, see https://github.com/K2InformaticsGmbH/oranif instead
Apache License 2.0
37 stars 11 forks source link

Implement periodic ping for the sessions #30

Closed shamis closed 7 years ago

shamis commented 7 years ago

Execute a ping periodically to check if the connection is active or not. If the connection is found stale delete the connection

cjbj commented 7 years ago

Just a heads up: if you are using the OCI session pool, in Oracle 12.2 the session pool has an always-enabled, lightweight check so pinging is unnecessary in the common failure scenario. In node-oracledb we skip the getConnection() ping when using 12.2 client. Discussion is in the node-oracledb doc. Also see the same in ODPI-C.

shamis commented 7 years ago

@cjbj so you are saying the connections in the oci pool has an internal ping. This requirement is to check the validity of a connection that is held on by the application. Not sure how the internal ping comes into perspective here

cjbj commented 7 years ago

@shamis yes, it is internal, so it covers some cases but not cases where users want to force a ping (though for scalability I'd still recommend they avoid pinging, and instead try the normal application logic and if it fails, re-connect and re-try the application logic. With OCI Application Continuity the OCI layer will do replays of work.) I was just giving you a FYI. Bottom line, OCI is trying to do more to make drivers like erloci easy to write and give them greater 'high availability'. The ODPI-C layer is also something to look at since it makes driver creation easier. We'll make node-oracledb and cx_Oracle use ODPI-C in the near future.

c-bik commented 7 years ago

@cjbj Thanks for your interest and inputs.

Bottom line, OCI is trying to do more to make drivers like erloci easy to write and give them greater 'high availability'.

Honestly C/C++ (native) part is quite old and not being kept updated to latest and greatest OCI features. Sometime soon it will definitely benefit from some upgrade efforts.

The ODPI-C layer is also something to look at since it makes driver creation easier.

ODPI-C looks interesting and perhaps completely (or with a small amount of glue coding) can replace erloci_lib.

A quick look into ODPI-C repo:

A C++ (with ref/sp instead) wrapper alternative would however be a better candidate than ODPI-C to upgrade erloci_lib with, if there is one -- OCCI perhaps?

We'll make node-oracledb and cx_Oracle use ODPI-C in the near future.

How are you performance bench marking node-oracledb?

cjbj commented 7 years ago

@c-bik Thanks for the points about ODPI-C. Improving C++ use is a topic we are discussing (/cc @tianfyang, @anthony-tuininga).

If you have any comments about how ODPI-C's API's would or wouldn't work for erloci, let us know before we go 'production'.

We run a bunch of load and stress tests with development-level benchmarks. This is in-house due to use of infrastructure tooling. Functional tests and doc will be added to ODPI-C as the project continues.