Handle count leak when connecting to Oracle via ODBC on Windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kong Li

    Handle count leak when connecting to Oracle via ODBC on Windows

    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.c om)
    Subject: Re: Handle count leak when connecting to Oracle via ODBC on
    Windows
    View: Complete Thread (4 articles)
    Original Format
    Newsgroups: comp.databases. oracle, comp.databases. oracle.misc,
    comp.databases. oracle.tools
    Date: 2004-02-09 11:50:07 PST


    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



    vslabs@onwe.co. za (Billy Verreynne) wrote in message news:<1a75df45. 0401270235.1940 d17c@posting.go ogle.com>...
    likong@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).
Working...