We are using ODBC connection pooling with DB2 v 8.1 on Win 2000 v5
sp4.
Each time we get a connection, SQLConnect, we see the memory usage go
up, about 52K. When we return the connection to the pool,
SQLDisconnect, and after the time that the connection remains in pool
expires we see the memory usage drop by about 28K.
Our basic steps for a select are:
SQLAllocHandle(SQL_HANDLE_DBC, hGblEnv, &hdbc);
SQLSetConnectAttr(hdbc, SQL_ATTR_LOGIN_TIMEOUT,
(SQLPOINTER)lLoginTimeOut, 0);
SQLSetConnectAttr(hdbc, SQL_ATTR_ACCESS_MODE,
(SQLPOINTER)SQL_MODE_READ_ONLY, SQL_IS_POINTER);
SQLConnect(hdbc,(SQLCHAR *)szDatabase, SQL_NTS,
(SQLCHAR *)szUserId, SQL_NTS,
(SQLCHAR *)szPassword, SQL_NTS);
SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
// Build the select statement
SQLExecDirect(hstmt, (SQLCHAR * )pszSQLStmt, strlen(pszSQLStmt));
SQLFetch(hstmt);
SQLFreeHandle (SQL_HANDLE_STMT, hstmt);
SQLDisconnect(hdbc);
Same memory leak occurs in SQL Server 2000, but that's another forum.
Mark Yudkin - 05 Mar 2004 07:52 GMT
You need to open this problem against the Microsoft MDAC. The very fact that
you have the same problem with both DB2 and SQL Server should alert you to
the likelhood of the problem's being in the MDAC drivers. Open the case with
Microsoft support.
> We are using ODBC connection pooling with DB2 v 8.1 on Win 2000 v5
> sp4.
[quoted text clipped - 21 lines]
>
> Same memory leak occurs in SQL Server 2000, but that's another forum.