Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Memory leak ADO-MSDAORA
Hi Charles -
I am having a similar problem. Note with your example that you are not
releasing the _ConnectionPtr - that wouldn't hurt to do. I doubt that
will solve your problem tho as I am closing and releasing my connection
and recordset and getting the memory leak as well.
If you figure it out - or hear that it is a published Microsoft bug, let me know!
Lynn_Bassler_at_yahoo.com
In article <37848FC4.C5373631_at_ping.be>,
Charles Edouard <cemd_at_ping.be> wrote:
>
> --------------67D22632C5E4FD2C8FAF2C52
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> ADO Memory leak.
> ---------------
> The following problem occurs with MSDAORA OleDB provider only, not
> with other providers like MSDASQL or Microsoft.Jet.OLEDB.4.0;
> The following program leaks if the CString SELECT is joining 2 tables.
>
> SELECT --> SELECT DISTINCT A.id, B.type
> FROM A,B
> WHERE A.id = '19990610-0007'
>
> if SELECT is a simple query on one table the program does not leak.
>
> SELECT --> SELECT id
> FROM A
> WHERE A.id = '19990610-0007'
>
> //////////////////////////////////////////////////////////////////////
> #import <msado15.dll> rename ("EOF", "adoEOF")
> void CTestAdoLeakDlg::OnGo()
> {
> ::CoInitialize(NULL);
> _bstr_t Connect("Provider=MSDAORA.1;Data Source=CTMC;User ID=DRO;
> Password=RSQ;");
>
> ADODB::_ConnectionPtr cn;
> HRESULT hr = cn.CreateInstance (__uuidof (ADODB::Connection));
> cn->Open (Connect, "", "", -1);
> CString SELECT;
> SELECT.Format("SELECT DISTINCT A.id, B.type FROM A,B WHERE A.id =
> '19990610-0007'");
> );
> _bstr_t Source(SELECT);
>
> do{
> ADODB::_RecordsetPtr rst = NULL;
> hr = rst.CreateInstance(__uuidof(ADODB::Recordset));
> rst->CursorLocation = ADODB::adUseServer;
> rst->CursorType = ADODB::adOpenForwardOnly;
> rst->LockType = ADODB::adLockReadOnly;
> rst->CacheSize = 1;
>
> hr = rst->Open(Source, cn.GetInterfacePtr(),
> ADODB::adOpenDynamic,ADODB::adLockOptimistic,-1);
> do{
> hr = rst->MoveNext();
> }while(!rst->adoEOF);
> hr = rst->Close();
> hr = rst->Release(); // Leaks
> }while(true);
>
> ::CoUninitialize();
> }
>
> Thank you for any solution you can provide
> Charles.
>
> --------------67D22632C5E4FD2C8FAF2C52
> Content-Type: text/html; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
> <html>
> <font face="Courier New,Courier"><font size=-1>ADO Memory
leak.</font></font>
> <br><font face="Courier New,Courier"><font size=-1>---------------
</font></font>
> <br><font face="Courier New,Courier"><font size=-1>The following
problem
> occurs with MSDAORA OleDB provider only, not</font></font>
> <br><font face="Courier New,Courier"><font size=-1>with other
providers
> like MSDASQL or Microsoft.Jet.OLEDB.4.0;</font></font>
> <br><font face="Courier New,Courier"><font size=-1>The following
program
> leaks if the CString SELECT is joining 2 tables.</font></font><font
face="Courier New,Courier"><font size=-1></font></font>
> <p><font face="Courier New,Courier"><font size=-1>SELECT -->
SELECT
> DISTINCT A.id, B.type</font></font>
> <br><font face="Courier New,Courier"><font size=-1> FROM
A,B</font></font>
> <br><font face="Courier New,Courier"><font size=-1> WHERE
A.id
> = '19990610-0007'</font></font><font face="Courier New,Courier"><font
size=-1></font></font>
> <p><font face="Courier New,Courier"><font size=-1>if SELECT is a
simple
> query on one table the program does not leak.</font></font><font
face="Courier New,Courier"><font size=-1></font></font>
> <p><font face="Courier New,Courier"><font size=-1>SELECT -->
SELECT
> id</font></font>
> <br><font face="Courier New,Courier"><font size=-1> FROM
A</font></font>
> <br><font face="Courier New,Courier"><font size=-1> WHERE
A.id
> = '19990610-0007'</font></font><font face="Courier New,Courier"><font
size=-1></font></font>
> <p><font face="Courier New,Courier"><font size=-
1>//////////////////////////////////////////////////////////////////////</font></font>
1></font></font>
> <br><font face="Courier New,Courier"><font size=-
1></font></font>
> <br><font face="Courier New,Courier"><font size=-
1></font></font>
> <br><font face="Courier New,Courier"><font size=-
1></font></font>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Wed Jul 21 1999 - 13:51:36 CDT
![]() |
![]() |