Skip to content

Commit

Permalink
Disable support added in Oracle Client 23ai for connection pool ping
Browse files Browse the repository at this point in the history
intervals since this functionality is already available in ODPI-C.
  • Loading branch information
anthony-tuininga committed Oct 25, 2024
1 parent 1a72e12 commit 1880a7d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/src/releasenotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Version 5.4.0 (TBD)
libraries by ensuring that the mode indicating bound REF CURSOR statement
handles are never re-used is only enabled with Oracle Client libraries 23.6
and higher.
#) Disable support added in Oracle Client 23ai for connection pool ping
intervals since this functionality is already available in ODPI-C.


Version 5.3 (July 23, 2024)
Expand Down
1 change: 1 addition & 0 deletions src/dpiImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ extern unsigned long dpiDebugLevel;
#define DPI_OCI_ATTR_IAM_PRIVKEY 637
#define DPI_OCI_ATTR_TOKEN_CBK 638
#define DPI_OCI_ATTR_TOKEN_CBKCTX 639
#define DPI_OCI_ATTR_PING_INTERVAL 655
#define DPI_OCI_ATTR_TOKEN_ISBEARER 657
#define DPI_OCI_ATTR_DOMAIN_SCHEMA 659
#define DPI_OCI_ATTR_DOMAIN_NAME 660
Expand Down
11 changes: 11 additions & 0 deletions src/dpiPool.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ static int dpiPool__create(dpiPool *pool, const char *userName,
const dpiCommonCreateParams *commonParams,
dpiPoolCreateParams *createParams, dpiError *error)
{
int32_t pingInterval;
uint32_t poolMode;
uint8_t getMode;
void *authInfo;
Expand Down Expand Up @@ -245,6 +246,16 @@ static int dpiPool__create(dpiPool *pool, const char *userName,
error) < 0)
return DPI_FAILURE;

// disable ping interval in Oracle Database 23ai since it does not handle
// ping timeout yet
if (pool->env->versionInfo->versionNum >= 23) {
pingInterval = -1;
if (dpiOci__attrSet(pool->handle, DPI_OCI_HTYPE_SPOOL,
(void*) &pingInterval, 0, DPI_OCI_ATTR_PING_INTERVAL,
"disable ping interval", error) < 0)
return DPI_FAILURE;
}

// set remaining attributes directly
pool->homogeneous = createParams->homogeneous;
pool->externalAuth = createParams->externalAuth;
Expand Down

0 comments on commit 1880a7d

Please sign in to comment.