Page 1 of 1
LoadedOCI , FreeOCI,...
Posted: Sat 28 Dec 2013 20:17
by redhair
Hi ODAC Support Team,
after installing the new ODAC 9.2.5 version, I 've got a compiler error:
[bcc32 error] ... E2268 Call to undefined function 'LoadedOCI'
The compiler can't found the methods LoadedOCI, FreeOCI,... anymore.
I 've also failed to find the 'LoadedOCI' function in the include directory of the ODAC components, but it is still in the help files...
What I have to do now?
Re: LoadedOCI , FreeOCI,...
Posted: Mon 30 Dec 2013 11:51
by AlexP
Hello,
In the new version we have added a possibility to work in the OCI and Direct modes simultaneously. Due to this, global methods were moved to appropriate classes. Now, you should work with TOraSession.Home:
Code: Select all
OraSession1.Home.Init
OraSession1.Home.Release
OraSession1.Home.Inited
P.S. In the next version, we will add these methods description to the help.
Re: LoadedOCI , FreeOCI,...
Posted: Fri 10 Jan 2014 16:36
by MarkF
I'm having some problems working with these changes. In my tests Home.Inited is never set to true. I've resorted to checking if Home.OCI7/8 are not nil and then checking their inited state. Is this a bug or am I doing something incorrectly?
-Mark
Benthic Software
Re: LoadedOCI , FreeOCI,...
Posted: Sat 11 Jan 2014 11:27
by AlexP
Hello,
The Inited property is set after either explicit Init method call or establishing a connection.
Re: LoadedOCI , FreeOCI,...
Posted: Sat 11 Jan 2014 13:52
by MarkF
In my testing Home.Inited does not return true even after initing it explicitly or after establishing a connection without an explicit init. Could you double check that?
-Mark
Benthic Software
Re: LoadedOCI , FreeOCI,...
Posted: Sat 11 Jan 2014 14:36
by AlexP
Hello,
Here is the code that displays the Inited property state. Please check this code, and if it does not reproduce your problem, please modify it so that it reproduces the problem and send it to us.
Code: Select all
program Project3;
{$APPTYPE CONSOLE}
uses
SysUtils, Ora, Oracall, variants;
Var
OraSession: TOraSession;
begin
OraSession := TOraSession.Create(nil);
try
OraSession.ConnectString := 'scott/tiger@orcl1120';
Writeln(VarToStr(OraSession.Home.Inited)); // False
OraSession.Home.Init;
Writeln(VarToStr(OraSession.Home.Inited)); // True
OraSession.Home.Release;
Writeln(VarToStr(OraSession.Home.Inited)); // False
OraSession.Connect;
Writeln(VarToStr(OraSession.Home.Inited)); // True
OraSession.Disconnect;
OraSession.Home.Release;
Writeln(VarToStr(OraSession.Home.Inited)); // False
finally
OraSession.Free;
readln;
end;
end.
Re: LoadedOCI , FreeOCI,...
Posted: Sat 11 Jan 2014 19:35
by MarkF
Is it possible that you have an already fixed version? Mine prints false for every writeln in that test.
-Mark
Re: LoadedOCI , FreeOCI,...
Posted: Mon 13 Jan 2014 09:55
by AlexP
Hello,
This code was tested on the latest "clean" version of ODAC 9.2.5. The Inited property can be False in the only case when on calling the Init method (or on a connection attempt) no Oracle client is found. Please clarify whether a connection to the server can be established in the sample I have provided, and if it can't, then what errors occur.
Re: LoadedOCI , FreeOCI,...
Posted: Mon 13 Jan 2014 13:57
by MarkF
I've gone into the code and found what appears to be the problem. You must be testing only with an Oracle Home that includes an OCIClient*.dll file (none of my homes have that file.) The bug relates to the check in TOracleHome.Inited:
Code: Select all
if OCIVersion < 8100 then
Result := FOCILib <> 0
else
Result := (FOCILib <> 0) and (FOCIClientLib <> 0);
So Inited will not return true in cases where the Oracle client is >= 8100 and doesn't include an OCIClient*.dll (which again, none of mine do.) Hopefully this helps understand the issue (I've fixed it for my case.)
This does bring up a question about what that file is used for and if it is required for ODAC (it seems to be related to XMLType streaming, which I've had problems with in the past as per my posted questions.)
-Mark
Benthic Software
Re: LoadedOCI , FreeOCI,...
Posted: Mon 13 Jan 2014 15:23
by MarkF
I've done a code compare between the 9.1 version and 9.2 and there are definitely some problems with the changes made relating to how oci.dll and ociclient*.dll are being handled now. I've changed mine to more closely match the 9.1 handling (which appears to be the correct one.)
-Mark
Benthic Software
Re: LoadedOCI , FreeOCI,...
Posted: Mon 13 Jan 2014 15:38
by AlexP
Hello,
Thank you for the information. We have reproduced the problem when oraclient*.dll is absent and will fix it in the nearest build.