ODBC SQLCloseCursor or SQLFreeHandle does not free the memory of CLOB field in Oracle.
- From: Vadivel (csvadivel@xxxxxxxxx)
- Date: Thu, 30 Jun 2005 22:39:03 -0700
Hi,
I am using a C++ application that connects to Oracle Database using EasySoft ODBC driver. I face a strange problem when freeing the memory after i fetch the CLOB data from the Oracle table.
The piece of Code is below,
char *pClobBuffer = new char[10485670]; // 10 MB
// Prepare the SQL statement
strcpy(pQuery, "SELECT clobdata FROM clobtable")
/* Execute the SQL statement. Check for errors. */
SQLExecDirect(stmtHandle,(SQLCHAR*)pQuery,SQL_NTS);
SQLFetch(stmtHandle);
SQLGetData(stmtHandle, 1, SQL_C_CHAR, clobBuffer, 10485670,&dError);
SQLCloseCursor(stmtHandle);
delete []pClobBuffer;
The statement and connection handle is closed properly. Still i am seeing the memory usage is exactly increasing by 10 MB(size of the buffer we allocated to read the CLOB) for each query.
This is not a memory leak, it's only the memory usage which is
increasing for the process for every query involving this CLOB field.
I tried changing the CLOB to Varchar in the database table, the above piece of Code works without increase in memory usage.
NOTE: We observed there is some special handling required to free the memory buffer allocated to read the CLOB field. In DB2 site they are saying SQLFreeStmt does not free the CLOB fields, FREE Alocator statement must be used. Please see the below link which i refered, but this one is for DB2.
http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com...
Please suggest me if any special handling is required for ORACLE to free the CLOB data.
Our Env: C++, Solaris, ODBC, ORACLE, EasySoft driver
thanks,
Vadivel.
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
.
- Follow-Ups:
- Prev by Date: Error 1918 ODBC when reinstalling Office 2000 after upgrading to X
- Next by Date: Re: Specifying character sets in ODBC
- Previous by thread: Error 1918 ODBC when reinstalling Office 2000 after upgrading to X
- Next by thread: RE: ODBC SQLCloseCursor or SQLFreeHandle does not free the memory of CLOB field in Oracle.
- Index(es):
Relevant Pages
|
|