|
Yet Another Connection Question
|
Joined: Apr 2003
Posts: 84 Parma, Italy
Member
|
OP
Member
Joined: Apr 2003
Posts: 84 Parma, Italy |
Hello,
Yesterday I was called to check a connection problem on a server in which there were several Delphi applications, some written with BDE and some with DOA (all of them working with Oracle 10.2). There was a connection problem with DOA applications only. Those written with BDE worked fine. I solved this defining a ORACLE_HOME system level environment variable. My curiosity is: how does BDE work ? in the BDE settings I only see "oci.dll" in vendor init but there isn't a path. Perhaps BDE checks the PATH variable ? If so why doesn't DOA do the same ? Just a curiosity . Thanks in advance Bye Nicola
|
|
|
Re: Yet Another Connection Question
|
Joined: Aug 1999
Posts: 22,208
Member
|
Member
Joined: Aug 1999
Posts: 22,208 |
Both Direct Oracle Access and the BDE use the PATH environment variable, though Direct Oracle Access also uses the registry to determine valid homes. If for some reason they use a different OCI library, then things will indeed not work.
Marco Kalter Allround Automations
|
|
|
Re: Yet Another Connection Question
|
Joined: Apr 2003
Posts: 84 Parma, Italy
Member
|
OP
Member
Joined: Apr 2003
Posts: 84 Parma, Italy |
This machine has only one Oracle Home and only one oci.dll. In the registry, though, the entries like "ALL_HOMES" and "HOME" are missing. The only registry key present is:
HKLM\Software\Oracle\KEY_OraClient10g_home2
Perhaps this could be the problem (I'll search the forum about this topic) ? Another strange thing is that users reported that the connection problem was not systematic but random. Sometimes they were able to use the DOA applications. This sounds strange to me. Could this be possible in your opinion ? Thanks Bye Nicola
|
|
|
Re: Yet Another Connection Question
|
Joined: Aug 1999
Posts: 22,208
Member
|
Member
Joined: Aug 1999
Posts: 22,208 |
What is the exact problem? Any error messages?
Marco Kalter Allround Automations
|
|
|
Re: Yet Another Connection Question
|
Joined: Apr 2003
Posts: 84 Parma, Italy
Member
|
OP
Member
Joined: Apr 2003
Posts: 84 Parma, Italy |
There was no error message of any kind. The connection simply failed. I haven't see personally this version, though. After the first errors programmer added this try except block in the application code: try TheOraclesession.Connected := true; except on E : Exception do ShowMessage('Connection failed error: ' + E.message); end;
I personally saw this version of the application end it showed nothing (i.e. there was an empty exception message).
|
|
|
Re: Yet Another Connection Question
|
Joined: Apr 2003
Posts: 84 Parma, Italy
Member
|
OP
Member
Joined: Apr 2003
Posts: 84 Parma, Italy |
The problem is coming out again. The ORACLE_HOME variable (at system level) is still in place but it doesn't help. I added some debugging (writes to event log window) statement to Oracle.pas and OracleCI.pas. The problem is in the OCIServerAttach call which returns -2. I tried searching the net and metalink but I still haven't found anything useful. May you help me please ? Thanks in advance Bye Nicola
|
|
|
Re: Yet Another Connection Question
|
Joined: Aug 1999
Posts: 22,208
Member
|
Member
Joined: Aug 1999
Posts: 22,208 |
The -2 status means "Invalid handle", indicating that the initialization of the Oracle Call Interface Environment already failed before this call.
Marco Kalter Allround Automations
|
|
|
Re: Yet Another Connection Question
|
Joined: Apr 2003
Posts: 84 Parma, Italy
Member
|
OP
Member
Joined: Apr 2003
Posts: 84 Parma, Italy |
The initialization is in procedure InitOCI in OracleCI.pas ? I have putted debug messages there too, but I haven't seen any error code. This is a terminal server machine with lot (nearly 100) applications written in Delphi. Only those written with DOA suffer this connection problem. Those written with the BDE always connect without any problem. It is the first time that I encounter a problem with doa and not bde, usually the reverse happens :-( Do you think it may depend on permissions ? I tried elevating user to administrators group but with no success. At the moment I keep a doa application logged in a administrator session. Keeping this in memory *seems* help other session to connect (perhaps they found oci already in memory). But still I wonder what does the bde do for connect ...... Thanks for your answer bye Nicola
|
|
|
Re: Yet Another Connection Question
|
Joined: Apr 2003
Posts: 84 Parma, Italy
Member
|
OP
Member
Joined: Apr 2003
Posts: 84 Parma, Italy |
Would it be possible, in your opinion, that the BDE is using an older connection mode (if any..) ? Something like oci7 or oci8 .. ?? We are using BDE511 sqlora8.dll has the timestamp 16/6/2000 6.12
|
|
|
Re: Yet Another Connection Question
|
Joined: Apr 2003
Posts: 84 Parma, Italy
Member
|
OP
Member
Joined: Apr 2003
Posts: 84 Parma, Italy |
Does the 4.1.1. version contain changes about OCI connection process ?
|
|
|
|
|
|