Print Thread
Page 2 of 2 1 2
Re: Unable to connect from DLL
mobermaier #59195 12/13/18 10:40 AM
Joined: Aug 1999
Posts: 22,177
Member
Offline
Member
Joined: Aug 1999
Posts: 22,177
Can you create a little test executable that connects to the database, and run it from the same Windows account on the same platform? Just to check that the Oracle Client is able to connect from a standard application?


Marco Kalter
Allround Automations
Re: Unable to connect from DLL
Marco Kalter #59197 12/13/18 12:21 PM
Joined: Apr 2006
Posts: 10
M
Member
Offline
Member
M
Joined: Apr 2006
Posts: 10
Tried that, that works fine. Apache mod / DLL and test program 64Bit, Delphi XE6 DOA 4.1.3.5, Apache/OHS is running as local system account, the exe with my local administrator account.
"Forcing" a different OCI dll works with the test executable as well. Does not work with OHS, guess the OCI layer is loaded before the Apache module is initialized. Both homes contain the same version of Oracle.


Re: Unable to connect from DLL
mobermaier #59240 12/18/18 03:01 PM
Joined: Apr 2006
Posts: 10
M
Member
Offline
Member
M
Joined: Apr 2006
Posts: 10
I'm still having this problem. Any idea how to identify the actual issue?

I have this very simple apache module, Delphi XE6, DOA 4.1.3.5, OHS 12.2.1.3:

Create a webbroker apache module:

library mod_webbroker;

uses
Winapi.ActiveX,
System.Win.ComObj,
Web.WebBroker,
Web.ApacheApp,
Web.HTTPD24Impl,
WebModuleUnit2 in 'WebModuleUnit2.pas' {WebModule3: TWebModule};

{$E .so}
{$R *.res}

// httpd.conf entries:
(*
LoadModule webbroker_module modules/mod_webbroker.dll
<Location /xyz>
SetHandler mod_webbroker-handler
</Location>
*)
module.
var
GModuleData: TApacheModuleData;
exports
GModuleData name 'webbroker_module';
begin
CoInitFlags := COINIT_MULTITHREADED;
Web.ApacheApp.InitApplication(@GModuleData);
Application.Initialize;
Application.WebModuleClass := WebModuleClass;
Application.Run;
end.


The WebModuleUnit2 only contains TOracleSession and this code:

procedure TWebModule3.WebModule3DefaultHandlerAction(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var sResponse, sUserName, sPassword, sDatabase: string;
begin
sResponse := '<html>' +
'<head><title>TEST D.O.A. Connectivity - TOracleSession</title></head>' +
'<body>';

sUserName := 'scott';
sPassword := 'tiger';
sDatabase := 'mydb';

with OracleSession1 do begin
Connected := False;
LogonUsername := sUserName;
LogonPassword := sPassword;
LogonDatabase := sDatabase;
ConnectAs := caNormal;
try
Connected := True;
sResponse := sResponse + Format('<font color="GREEN">%s@%s CONNECTED</font><br>', [sUserName, sDatabase]);
except
on e:Exception do
sResponse := sResponse + Format('<font color="RED">Connect Error [%s@%s]: %s</font><br>', [sUserName, sDatabase, e.Message]);
end;
end;

sResponse := sResponse + '</body></html>';
Response.Content := sResponse;
end;


and the only thing I'm getting is:

Connect Error [scott@mydb]: Access violation at address 00007FFB78895014 in module 'oraclient12.dll'. Write of address 0000000000000018

TNSPing and sqlplus works, and a stand alone application does as well.

Any ideas?

Re: Unable to connect from DLL
mobermaier #59246 12/19/18 10:26 AM
Joined: Aug 1999
Posts: 22,177
Member
Offline
Member
Joined: Aug 1999
Posts: 22,177
If the Oracle Home is the same, and a standalone application works correctly, then I can only imagine that there is an environment difference between the standalone application and the Apache DLL. Perhaps there is an account privilege difference, or an environment variable difference (ORACLE_HOME, NLS_LANG, TNS_ADMIN, PATH, ...).


Marco Kalter
Allround Automations
Re: Unable to connect from DLL
G Spears #64382 01/13/23 02:52 PM
Joined: Jan 2023
Posts: 6
A
Member
Offline
Member
A
Joined: Jan 2023
Posts: 6
Hello! We are now running into the same problem. Did you finally find a solution?

Page 2 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.061s Queries: 16 (0.015s) Memory: 2.5385 MB (Peak: 3.0377 MB) Data Comp: Off Server Time: 2024-03-29 14:57:02 UTC
Valid HTML 5 and Valid CSS