Microsoft Knowledge Base Email Alertz

(286204) - 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...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 286204 - Last Review: November 17, 2003 - Revision: 3.1

PRB: Slow CGI Performance with Microsoft ODBC for Oracle on Windows NT 4.0

This article was previously published under Q286204

On This Page

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
				

APPLIES TO
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.5 Service Pack 1
  • Microsoft Data Access Components 2.6
Keywords: 
kbbug kboracle kbprb kbqfe KB286204
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate