Topic: Just another Oracle Instant Client bugfix!
|
|
bootsector
User
 Expert Boarder
| Posts: 45 |   | Karma: 2 |
|
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 Start: Thread ID: 5000. Process Project1.exe (6100)
Process Start: C:\Documents and Settings\Administrator\Desktop\Delphi Teste\Project1.exe. Base Address: $00400000. Process Project1.exe (6100)
Module Load: Project1.exe. Has Debug Info. Base Address: $00400000. Process Project1.exe (6100)
Module Load: ntdll.dll. No Debug Info. Base Address: $7C900000. Process Project1.exe (6100)
Module Load: KERNEL32.dll. No Debug Info. Base Address: $7C800000. Process Project1.exe (6100)
Module Load: OLEAUT32.dll. No Debug Info. Base Address: $77120000. Process Project1.exe (6100)
Module Load: msvcrt.dll. No Debug Info. Base Address: $77C10000. Process Project1.exe (6100)
Module Load: USER32.dll. No Debug Info. Base Address: $77D40000. Process Project1.exe (6100)
Module Load: GDI32.dll. No Debug Info. Base Address: $77F10000. Process Project1.exe (6100)
Module Load: ADVAPI32.dll. No Debug Info. Base Address: $77DD0000. Process Project1.exe (6100)
Module Load: RPCRT4.dll. No Debug Info. Base Address: $77E70000. Process Project1.exe (6100)
Module Load: ole32.dll. No Debug Info. Base Address: $774E0000. Process Project1.exe (6100)
Module Load: VERSION.dll. No Debug Info. Base Address: $77C00000. Process Project1.exe (6100)
Module Load: COMCTL32.dll. No Debug Info. Base Address: $5D090000. Process Project1.exe (6100)
Module Load: IMM32.dll. No Debug Info. Base Address: $76390000. Process Project1.exe (6100)
Module Load: LPK.dll. No Debug Info. Base Address: $629C0000. Process Project1.exe (6100)
Module Load: USP10.dll. No Debug Info. Base Address: $74D90000. Process Project1.exe (6100)
Module Load: msctfime.ime. No Debug Info. Base Address: $755C0000. Process Project1.exe (6100)
Thread Start: Thread ID: 2808. Process Project1.exe (6100)
Module Load: OCI.dll. No Debug Info. Base Address: $10000000. Process Project1.exe (6100)
Module Load: MSVCR71.dll. No Debug Info. Base Address: $7C340000. Process Project1.exe (6100)
Module Load: PSAPI.DLL. No Debug Info. Base Address: $76BF0000. Process Project1.exe (6100)
Module Load: OraOCIICUS10.dll. No Debug Info. Base Address: $00C60000. Process Project1.exe (6100)
Module Load: WS2_32.dll. No Debug Info. Base Address: $71AB0000. Process Project1.exe (6100)
Module Load: WS2HELP.dll. No Debug Info. Base Address: $71AA0000. Process Project1.exe (6100)
Module Load: WINMM.dll. No Debug Info. Base Address: $76B40000. Process Project1.exe (6100)
Module Load: CRYPT32.dll. No Debug Info. Base Address: $77A80000. Process Project1.exe (6100)
Module Load: MSASN1.dll. No Debug Info. Base Address: $77B20000. Process Project1.exe (6100)
Debug Output: HEAP[Project1.exe]: Process Project1.exe (6100)
Debug Output: Invalid Address specified to RtlFreeHeap( 00140000, 00151B50 ) 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
|
|
Diman
Admin
 Admin
| Posts: 1482 |  | Karma: 19 |
|
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
WSAData: TWSAData;
procedure Startup;
var
ErrorCode: Integer;
begin
ErrorCode := WSAStartup($0101, WSAData);
if ErrorCode <> 0 then
raise ESocketError.Create('WSAStartup');
end;
procedure Cleanup;
var
ErrorCode: Integer;
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
|
|
bootsector
User
 Expert Boarder
| Posts: 45 |   | Karma: 2 |
|
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
|
|
Diman
Admin
 Admin
| Posts: 1482 |  | Karma: 19 |
|
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
|
|
bootsector
User
 Expert Boarder
| Posts: 45 |   | Karma: 2 |
|
bootsector
User
 Expert Boarder
| Posts: 45 |   | Karma: 2 |
|
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
|
|
|