Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Just another Oracle Instant Client bugfix!
Just another Oracle Instant Client bugfix!
Posted: 2007/05/17 07:33
 
Hi Diman,

I was having the following Desig Time issue when putting ADConnection1.Connected := True; inside a DataModule onCreate event:


 Thread StartThread ID5000. Process Project1.exe (6100) Process StartC:\Documents and Settings\Administrator\Desktop\Delphi Teste\Project1.exeBase Address: $00400000. Process Project1.exe (6100) Module LoadProject1.exeHas Debug InfoBase Address: $00400000. Process Project1.exe (6100) Module Loadntdll.dllNo Debug InfoBase Address: $7C900000Process Project1.exe (6100) Module LoadKERNEL32.dllNo Debug InfoBase Address: $7C800000Process Project1.exe (6100) Module LoadOLEAUT32.dllNo Debug InfoBase Address: $77120000. Process Project1.exe (6100) Module Loadmsvcrt.dllNo Debug InfoBase Address: $77C10000Process Project1.exe (6100) Module LoadUSER32.dllNo Debug InfoBase Address: $77D40000Process Project1.exe (6100) Module LoadGDI32.dllNo Debug InfoBase Address: $77F10000Process Project1.exe (6100) Module LoadADVAPI32.dllNo Debug InfoBase Address: $77DD0000Process Project1.exe (6100) Module LoadRPCRT4.dllNo Debug InfoBase Address: $77E70000Process Project1.exe (6100) Module Loadole32.dllNo Debug InfoBase Address: $774E0000Process Project1.exe (6100) Module LoadVERSION.dllNo Debug InfoBase Address: $77C00000Process Project1.exe (6100) Module LoadCOMCTL32.dllNo Debug InfoBase Address: $5D090000Process Project1.exe (6100) Module LoadIMM32.dllNo Debug InfoBase Address: $76390000. Process Project1.exe (6100) Module LoadLPK.dllNo Debug InfoBase Address: $629C0000Process Project1.exe (6100) Module LoadUSP10.dllNo Debug InfoBase Address: $74D90000Process Project1.exe (6100) Module Loadmsctfime.imeNo Debug InfoBase Address: $755C0000Process Project1.exe (6100) Thread StartThread ID2808. Process Project1.exe (6100) Module LoadOCI.dllNo Debug InfoBase Address: $10000000. Process Project1.exe (6100) Module LoadMSVCR71.dllNo Debug InfoBase Address: $7C340000Process Project1.exe (6100) Module LoadPSAPI.DLLNo Debug InfoBase Address: $76BF0000Process Project1.exe (6100) Module LoadOraOCIICUS10.dllNo Debug InfoBase Address: $00C60000Process Project1.exe (6100) Module LoadWS2_32.dllNo Debug InfoBase Address: $71AB0000Process Project1.exe (6100) Module LoadWS2HELP.dllNo Debug InfoBase Address: $71AA0000Process Project1.exe (6100) Module LoadWINMM.dllNo Debug InfoBase Address: $76B40000Process Project1.exe (6100) Module LoadCRYPT32.dllNo Debug InfoBase Address: $77A80000Process Project1.exe (6100) Module LoadMSASN1.dllNo Debug InfoBase Address: $77B20000Process Project1.exe (6100) Debug OutputHEAP[Project1.exe]:  Process Project1.exe (6100) Debug OutputInvalid Address specified to RtlFreeHeap0014000000151B50 )  Process Project1.exe (6100)



Then after a couple of tests I've found out that was due winsock DLL's weren't being loaded BEFORE oracle client tried to make the connection to a remote server. All I had to do was add Sockets unit to the 'uses' clause of my DataModule's unit.

So my suggestion is to add Sockets unit in the uses clause inside one of AnyDAC Oracle related units (like daADPhysOracl, for example).

I don't know if this issue affects stardard Oracle Client, but it does with Oracle Instant Client. And this suggested workaround would resolve this problem!

Thanks for your support, Diman! Keep up the great job!

P.S.: I just can't wait for 2.0 version and FireBird support!

Best regards,

Bruno
Re:Just another Oracle Instant Client bugfix!
Posted: 2007/05/17 08:24
 
Hello Bruno

Strange issue - I see it first time ...

I will prefer do not link to Sockets unit. As workaround, please do following:
- remove reference to Sockets;
- the add following code to any of units:


 uses   WinSock; ............. var   WSADataTWSAData; procedure Startup; var   ErrorCodeInteger; begin   ErrorCode := WSAStartup($0101WSAData);   if ErrorCode <> 0 then     raise ESocketError.Create('WSAStartup'); end; procedure Cleanup; var   ErrorCodeInteger; begin   ErrorCode := WSACleanup;   if ErrorCode <> 0 then     raise ESocketError.Create('WSACleanup'); end; initialization   Startup; finalization   Cleanup; end.



If that will work, then I will add that code to AnyDAC source base.

Regards,
Dmitry
Re:Just another Oracle Instant Client bugfix!
Posted: 2007/05/17 08:40
 
Hey Diman!

This solution worked flawlessly!

I just had to add ScktComp to the uses clause because of ESocketError class.

BTW, I added your code to daADPhysOracl, if this info matters!

Thanks for your support!

Regards,

Bruno
Re:Just another Oracle Instant Client bugfix!
Posted: 2007/05/17 09:00
 
Ok.

Btw, what is your Oracle client version and Windows version ?

Regards,
Dmitry
Re:Just another Oracle Instant Client bugfix!
Posted: 2007/05/17 10:12
 
Diman,

I am using Oracle Instant Client 1.2.0.3: http://download.oracle.com/otn/nt/instantclient/instantclient-basiclite-win32-10.2.0.3-20061115.zip

and Microsoft Windows XP Professional SP2

AnyDAC is installed under Turbo Delphi Explorer!

Thanks,

Bruno
Re:Just another Oracle Instant Client bugfix!
Posted: 2007/05/17 10:26
 
Diman,

You are right, this is a very weird bug, because I could only get it when using the OnCreate method of the DataModule. If I add a Form with a button then let the button click event as DataModule.ADConnection1.Connected := True; I don't get the debug screen when running from Delphi IDE.

It looks like putting the Connected := True inside the OnCreate event it's not giving enough time for application to load the sockets library. I don't know, just guessing around!

Thanks,

Bruno