Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Handle count leak when connecting to Oracle via ODBC on Windows
"Kong Li" <likong_at_email.com> a écrit dans le message de
news:9e121089.0402091150.603e308b_at_posting.google.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 SQLDriverConnect, the handle
> count increases quiet a few. After the SQLFreeHandle(SQL_HANDLE_DBC,
> hdbc), the handle count drops back but is still 2 more than the handle
> count value before SQLDriverConnect.
>
> 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(SQLDriverConnect(hdbc,...))) {
> SQLDisconnect(hdbc);
> }
> SQLFreeHandle(SQL_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. Received on Fri Apr 23 2004 - 14:11:21 CDT