473,699 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handle count leak when connecting to Oracle via ODBC on Windows

Environments:
1. WinXP SP1, MDAC 2.7 SP1 (Microsoft ODBC for Oracle is
2.573.9030.0), Oracle client 9.2.0.1.
2. Win2000 SP4, MDAC 2.7 SP1 (Microsoft ODBC for Oracle is
2.573.9030.0), Oracle client 9.2.0.1.
3. Win2000 SP4, MDAC 2.8 (Microsoft ODBC for Oracle is 2.573.1022.0),
Oracle client 9.2.0.1.

I have a simple program calling SQLDriverConnec t (not OLEDB, not ADO,
but ODBC) to an Oracle server 9.2, and then disconnect. The value of
handle count increases by 2 each time I did the connect/disconnect.
This has been verified on the above 3 environments. Turning on/off
ODBC connection pooling does not change the handle count leakage.

Connection caching is not an option for me since the application
connects to a set of Oracle servers that keep changing.

Is this a known problem? I did not try Oracle's own ODBC driver.

Any pointers, ideas?

Thanks.

Kong
li****@email.co m
Jul 19 '05 #1
4 7909
li****@email.co m (Kong Li) wrote in message news:<9e******* *************** ****@posting.go ogle.com>...
Environments:
1. WinXP SP1, MDAC 2.7 SP1 (Microsoft ODBC for Oracle is
2.573.9030.0), Oracle client 9.2.0.1.
2. Win2000 SP4, MDAC 2.7 SP1 (Microsoft ODBC for Oracle is
2.573.9030.0), Oracle client 9.2.0.1.
3. Win2000 SP4, MDAC 2.8 (Microsoft ODBC for Oracle is 2.573.1022.0),
Oracle client 9.2.0.1.

I have a simple program calling SQLDriverConnec t (not OLEDB, not ADO,
but ODBC) to an Oracle server 9.2, and then disconnect. The value of
handle count increases by 2 each time I did the connect/disconnect.
This has been verified on the above 3 environments. Turning on/off
ODBC connection pooling does not change the handle count leakage.

Connection caching is not an option for me since the application
connects to a set of Oracle servers that keep changing.

Is this a known problem? I did not try Oracle's own ODBC driver.

Any pointers, ideas?

Thanks.

Kong
li****@email.co m

From the Microsoft ODBC's version number it looks like you are using a
Oracle 7 compatible ODBC driver. I don't think Oracle 9.2 supports
Oracle 7 connections any longer. You could verify the sqlnet version
being used by selecting from v$session. If it shows TNS V1-V2 instead
of TNS V1-V3 you are using an obsolete driver.

Sybrand Bakker
Senior Oracle DBA
Jul 19 '05 #2
li****@email.co m (Kong Li) wrote
I have a simple program calling SQLDriverConnec t (not OLEDB, not ADO,
but ODBC) to an Oracle server 9.2, and then disconnect. The value of
handle count increases by 2 each time I did the connect/disconnect.
This has been verified on the above 3 environments. Turning on/off
ODBC connection pooling does not change the handle count leakage.
If it works the same way on different versions, maybe then it works as
designed. I would think that a handle counter cannot really "leak" in
the same way as allocated handles leak memory when not properly
freed...
Is this a known problem? I did not try Oracle's own ODBC driver.
Is this the right forum to ask ODBC related questions? IMO not.
Any pointers, ideas?


Try the question in a ODBC/Microsoft forum. Use a MSAccess or
SQL-Server driver to determine if this is related to Oracle ODBC
driver only. Read the ODBC API specification to determine exactly how
the handle count works. Connect your app to the ODBC driver via an
ODBC debugger (there used to be a great one in the ODBC DDK that
shipped with DevNet in the 90's).

--
Billy
Jul 19 '05 #3
Follow up to this thread,
Instead of Microsoft ODBC for Oracle, I also used Oracle ODBC driver
(version 9.02.00.54) while keeping everything else the same. There is
also handle count leak. 2 per
AllocHandle/connect/disconnect/FreeHandle, identical to the behavior
of using Microsoft ODBC for Oracle.

To be more specific, after a successful SQLDriverConnec t, the handle
count increases quiet a few. After the SQLFreeHandle(S QL_HANDLE_DBC,
hdbc), the handle count drops back but is still 2 more than the handle
count value before SQLDriverConnec t.

I used the same code to connect to SQL 2000 with MSSQL ODBC driver
(version 2000.81.9042.00 ). There is no handle count leak. This leads
me to believe the code itself is correct.

The Oracle server is 9i (9.2.0).

Here is the skelton code:

SQLAllocHandle( SQL_HANDLE_ENV, NULL, &henv);
while (true) {
construct connection string for a new Oracle server
SQLAllocHandle( SQL_HANDLE_DBC, henv, &hdbc);
if (SQL_SUCCEEDED( SQLDriverConnec t(hdbc,...))) {
SQLDisconnect(h dbc);
}
SQLFreeHandle(S QL_HANDLE_DBC, hdbc);
}

Any ideas or pointers?

Thanks.

Kong

vs****@onwe.co. za (Billy Verreynne) wrote in message news:<1a******* *************** ****@posting.go ogle.com>...
li****@email.co m (Kong Li) wrote
I have a simple program calling SQLDriverConnec t (not OLEDB, not ADO,
but ODBC) to an Oracle server 9.2, and then disconnect. The value of
handle count increases by 2 each time I did the connect/disconnect.
This has been verified on the above 3 environments. Turning on/off
ODBC connection pooling does not change the handle count leakage.


If it works the same way on different versions, maybe then it works as
designed. I would think that a handle counter cannot really "leak" in
the same way as allocated handles leak memory when not properly
freed...
Is this a known problem? I did not try Oracle's own ODBC driver.


Is this the right forum to ask ODBC related questions? IMO not.
Any pointers, ideas?


Try the question in a ODBC/Microsoft forum. Use a MSAccess or
SQL-Server driver to determine if this is related to Oracle ODBC
driver only. Read the ODBC API specification to determine exactly how
the handle count works. Connect your app to the ODBC driver via an
ODBC debugger (there used to be a great one in the ODBC DDK that
shipped with DevNet in the 90's).

Jul 19 '05 #4

"Kong Li" <li****@email.c om> a écrit dans le message de
news:9e******** *************** ***@posting.goo gle.com...
Follow up to this thread,
Instead of Microsoft ODBC for Oracle, I also used Oracle ODBC driver
(version 9.02.00.54) while keeping everything else the same. There is
also handle count leak. 2 per
AllocHandle/connect/disconnect/FreeHandle, identical to the behavior
of using Microsoft ODBC for Oracle.

To be more specific, after a successful SQLDriverConnec t, the handle
count increases quiet a few. After the SQLFreeHandle(S QL_HANDLE_DBC,
hdbc), the handle count drops back but is still 2 more than the handle
count value before SQLDriverConnec t.

I used the same code to connect to SQL 2000 with MSSQL ODBC driver
(version 2000.81.9042.00 ). There is no handle count leak. This leads
me to believe the code itself is correct.

The Oracle server is 9i (9.2.0).

Here is the skelton code:

SQLAllocHandle( SQL_HANDLE_ENV, NULL, &henv);
while (true) {
construct connection string for a new Oracle server
SQLAllocHandle( SQL_HANDLE_DBC, henv, &hdbc);
if (SQL_SUCCEEDED( SQLDriverConnec t(hdbc,...))) {
SQLDisconnect(h dbc);
}
SQLFreeHandle(S QL_HANDLE_DBC, hdbc);
}

Any ideas or pointers?

Thanks.

Kong


Does it actually break after N connections ? I've seen this occuring in the
OLD days of oracle 7.1.6 wit OCI programs that repeatedly
connected/diconnected.

Why don't you use the newest ORACLE ODBC drivers instead of Micro$oft ? You
could use the new features of the database and maybe fix the problem at the
same time.

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1386
by: Kong Li | last post by:
Follow up to this thread, the latest Oracle 9i release 2 patchset (9.2.0.5) fixed the handle count leak problem. The problem is in Oracle client component. Thanks. Kong ----- From: Kong Li (likong@email.com)
3
1958
by: va | last post by:
I am trying to establish a connection to Oracle 9i from asp.net.(.net 2003) The code is Dim con As New ADODB.Connection con.ConnectionString = "PROVIDER=MSDASQL;DRIVER= {Microsoft ODBC for oracle};SERVER={server name};UID={user id};PWD={password};" con.Open()
1
1752
by: yahibble | last post by:
Now, I am no Python expert but I have dabbled and I have spent a couple of days with another engineer unsuccessfully installing oracle drivers for MS ODBC on the win XP machine. It looked to me like ODBC was the best way to get a (free) python module to upload data to an oracle database table. Aside from installing oracle clients to ODBC being a pain, I would like to consider other ways to connect. Has anyone had experiences with...
12
4009
by: Ken Brubaker | last post by:
I am using DB2 8.5 FP5 on Windows 2000 Server and have noticed what appears to be a handle leak. When I execute a DB2 connect statement in a command window, followed by a DB2 connect reset statement, The number of handles displayed in Windows Task Manager for the db2syscs process does not return to its original value, but to 1 handle higher. While this is not a serious issue most of the time, we have applications connecting every 30...
4
3728
by: Terry | last post by:
There are a number of things about using unmanaged resources in Windows Forms programming that is unclear to me. In C++, if you loaded an icon resource using "ExtractIcon()", the resource was valid until you called "DestroyIcon()". If you didn't, you had a leak. In C#, I need to load icons from unmanaged programs (.exe, dll) at run time and I want to make sure I'm not leaking resources, but it's not clear to me how to insure that I'm...
3
10776
by: Andrew McGregor | last post by:
Hi, I am trying to get a VB.NET application to connect to a local Oracle 9i Lite database. What is the correct form for a connect string? cn = New Microsoft.Data.Odbc.OdbcConnection("dsn=POLite;Trusted_Connection=yes;User Id=SYSTEM;Password=MANAGER")
2
3669
by: Mahesh.V | last post by:
Hi All I get the following error while connecting to the oracle database using ODBC. in my VB.NET application. Can any one help me out solving this problem server message (if any): "ORA-12154:TNS:could not resolve service name Thank in Advance Mahesh.V
16
9184
by: network-admin | last post by:
We have Problems with Access query on Oracle 10g Database with ODBC Connection. The Query_1 is such as select * from xtable where ycolumn <"S" Result = ODBC Faild ----------------------------------------------------
0
8697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8621
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8929
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7759
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5878
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4634
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2357
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.