PRB: Slow CGI Performance with Microsoft ODBC for Oracle on Windows NT 4.0 (286204)
The information in this article applies to:
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.5 SP1
- Microsoft Data Access Components 2.6
This article was previously published under Q286204 SYMPTOMS
After installing Microsoft Data Access Components (MDAC) version 2.5 or later, the open and close performance of a single connection to the Microsoft ODBC for Oracle driver is noticeably slower. This impacts the performance of typical single connection open/close applications such as Common Gateway Interface (CGI) applications.
RESOLUTION
To fix the performance problem, add the following code to your application prior to opening the first connection to the Microsoft ODBC for Oracle driver:
LoadLibrary( "mtxdm.dll" );
LoadLibrary( "mtxoci.dll" );
STATUS
This behavior is by design.
MORE INFORMATION
This issue does not impact applications that load and unload connections over and over and continue to run. The problem applies only to applications that start up, open a connection, close the connection, and then terminate.
This problem does not occur on Microsoft Windows 2000; it has only been reported on Microsoft Windows NT 4.0 with MDAC 2.5 or later installed. The problem may also occur on Microsoft Windows 95, Windows 98, and Windows Millennium Edition (Me), but this has not been tested. Steps To Reproduce Behavior
To reproduce the problem, create a new Microsoft Visual C++ console application and add the following code. Run the code sample with the calls to LoadLibrary commented out (as they are below), and then run the sample again with the code uncommented. The performance with the calls in place should be faster.
// START CODE SAMPLE
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <sql.h>
#include <sqlext.h>
// Helper function to print elapsed time.
void PE( char* pszCaption, DWORD dwStart )
{
DWORD dwElapsed;
dwElapsed = GetTickCount() - dwStart;
printf( "[%20s] Elapsed %04lu.%04lu.\n",
pszCaption,
dwElapsed/1000,
dwElapsed%1000 );
}
void main(void)
{
RETCODE rc;
HENV henv = NULL;
HDBC hdbc = NULL;
// Set this to your Oracle DSN, UID and PWD.
SQLCHAR szConnect[] = "DSN=ORACLE805;UID=PSS;PWD=PSS;";
DWORD dwStart, i;
for( i=1; i<=3; i++ )
{
dwStart = GetTickCount();
printf( "=========================================\n" );
// Un-comment these 2 lines to fix problem.
// LoadLibrary( "mtxdm.dll" );
// LoadLibrary( "mtxoci.dll" );
// Allocate environment handle.
rc = SQLAllocEnv( &henv );
PE( "SQLAllocEnv", dwStart );
// Allocate connection handle.
rc = SQLAllocConnect( henv, &hdbc );
PE( "SQLAllocConnect", dwStart );
// Connect to data source.
rc = SQLDriverConnect( hdbc,
NULL,
szConnect,
SQL_NTS,
NULL,
0,
NULL,
SQL_DRIVER_NOPROMPT );
PE( "SQLDriverConnect", dwStart );
// Disconnect and free connection and henv.
rc = SQLDisconnect( hdbc );
PE( "SQLDisconnect", dwStart );
rc = SQLFreeConnect( hdbc );
PE( "SQLFreeConnect", dwStart );
rc = SQLFreeEnv( henv );
PE( "SQLFreeEnv", dwStart );
henv = NULL;
hdbc = NULL;
}
printf( "Press any key to exit test.\n" );
_getch();
}
// END CODE SAMPLE
Modification Type: | Major | Last Reviewed: | 11/17/2003 |
---|
Keywords: | kbBug kbOracle kbprb kbQFE KB286204 |
---|
|