Please please please keep the pressure on this subject.

Frankly, then SAPDB Win32 ODBC driver is a piece of problem code.  Some of
these leaks could very well be the cause of the instability that we see
under heavy concurrent load (one client machine with 40 or more concurrent
sessions doing lots of tiny SELECT statements).  If there is network packet
loss, it is just a matter of time until the driver stalls.

BTW:  The latest version of the Win32 ODBC driver I seem to be getting when
I download is dated 4/16/2003 - have no improvements been made in over 3
months?  Anyone have a newer one?

Thanks for the chance to rant :)

  Stephen Gutknecht


-----Original Message-----
From: J. Jeff Roberts [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 25, 2003 10:31 AM
To: [EMAIL PROTECTED]
Subject: BoundsChecker and SAP ODBC Driver


While tracking down our own leaks, I found that BoundsChecker believes
that we're leaking memory, handles and semaphores from the SAP ODBC
driver (sqluser74.dll, sqlod32.dll).

If I run the small program below to simply connect to a database and
disconnect, BoundsChecker reports two regular memory leaks, one for
something allocated by MapViewOfFile(), and 116 "nested leaks".  

It also reports 9 resource leaks for things allocated by
DuplicateHandle(), CreateSemaphore(), CreateFile() and TlsAlloc().

Finally, it always claims that I've leaked the SQLHENV and the SQLHDBC.

Some of these may just be BoundsChecker weirdness, and if you know of
BC settings I can change, please let me know.  But even outside of
BoundsChecker if I watch the Task Manager I see 5 handles being leaked
every time I run this little testcase.

Am I calling something out of sequence, or am I missing some calls that
would free some handles?

-Jeff

=======================================================================

#include "stdafx.h"

int main(int argc,char* argv[])
{
   SQLRETURN  nResult;
   SQLHENV    hEnvHandle;
   SQLHDBC    hDBHandle;

   nResult = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE,
&hEnvHandle);

   nResult = SQLSetEnvAttr(hEnvHandle, SQL_ATTR_ODBC_VERSION,
(SQLPOINTER) SQL_OV_ODBC3, SQL_IS_INTEGER);

   nResult = SQLAllocHandle(SQL_HANDLE_DBC, hEnvHandle, &hDBHandle);

   SQLSMALLINT  ConnInSize;
   SQLUSMALLINT DriverCompInd;
   SQLCHAR      ConnOut[1500];
   SQLSMALLINT  ConnOutMaxSize;
   SQLSMALLINT  ConnOutSize;
   SQLHWND      WinHandle;
   char         szConnect[2048];

   strcpy(szConnect, "DRIVER={SAP
DB};SERVERNODE=localhost;SERVERDB=lddtest;UID=lexadmin;PWD=lexadmin;OPTION=3
");

   ConnInSize     = strlen(szConnect);
   DriverCompInd  = SQL_DRIVER_NOPROMPT;
   ConnOutSize    = 0;
   ConnOutMaxSize = 0;
   WinHandle = NULL;

   nResult = SQLDriverConnect(hDBHandle,
                              WinHandle,
                              (SQLCHAR*)szConnect,
                              ConnInSize,
                              ConnOut,
                              ConnOutMaxSize,
                              &ConnOutSize,
                              DriverCompInd);

   nResult= SQLDisconnect(hDBHandle);

   nResult = SQLFreeHandle(SQL_HANDLE_DBC, hDBHandle);
   
   nResult = SQLFreeHandle(SQL_HANDLE_ENV, hEnvHandle);
   
   return(0);
}


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to