Skip to content

Commit

Permalink
Set the LOB prefetch length attribute in order to reduce the number o…
Browse files Browse the repository at this point in the history
…f round

trips to determine the length and chunk size of the LOB.
  • Loading branch information
anthony-tuininga committed Jun 11, 2019
1 parent bd2c7e0 commit 58e6a07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dpiImpl.h
Expand Up @@ -264,6 +264,7 @@ extern unsigned long dpiDebugLevel;
#define DPI_OCI_ATTR_CONNECTION_CLASS 425
#define DPI_OCI_ATTR_PURITY 426
#define DPI_OCI_ATTR_RECEIVE_TIMEOUT 436
#define DPI_OCI_ATTR_LOBPREFETCH_LENGTH 440
#define DPI_OCI_ATTR_SUBSCR_IPADDR 452
#define DPI_OCI_ATTR_UB8_ROW_COUNT 457
#define DPI_OCI_ATTR_SPOOL_AUTH 460
Expand Down
10 changes: 10 additions & 0 deletions src/dpiStmt.c
Expand Up @@ -479,6 +479,7 @@ static int dpiStmt__define(dpiStmt *stmt, uint32_t pos, dpiVar *var,
{
void *defineHandle = NULL;
dpiQueryInfo *queryInfo;
int tempBool;

// no need to perform define if variable is unchanged
if (stmt->queryVars[pos - 1] == var)
Expand Down Expand Up @@ -513,6 +514,15 @@ static int dpiStmt__define(dpiStmt *stmt, uint32_t pos, dpiVar *var,
return DPI_FAILURE;
}

// specify that the LOB length should be prefetched
if (var->nativeTypeNum == DPI_NATIVE_TYPE_LOB) {
tempBool = 1;
if (dpiOci__attrSet(defineHandle, DPI_OCI_HTYPE_DEFINE,
(void*) &tempBool, 0, DPI_OCI_ATTR_LOBPREFETCH_LENGTH,
"set lob prefetch length", error) < 0)
return DPI_FAILURE;
}

// define objects, if applicable
if (var->buffer.objectIndicator && dpiOci__defineObject(var, defineHandle,
error) < 0)
Expand Down

0 comments on commit 58e6a07

Please sign in to comment.