LoadedOCI , FreeOCI,...

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
redhair
Posts: 11
Joined: Thu 20 Jun 2013 08:19

LoadedOCI , FreeOCI,...

Post by redhair » Sat 28 Dec 2013 20:17

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?

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: LoadedOCI , FreeOCI,...

Post by AlexP » Mon 30 Dec 2013 11:51

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.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Re: LoadedOCI , FreeOCI,...

Post by MarkF » Fri 10 Jan 2014 16:36

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: LoadedOCI , FreeOCI,...

Post by AlexP » Sat 11 Jan 2014 11:27

Hello,

The Inited property is set after either explicit Init method call or establishing a connection.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Re: LoadedOCI , FreeOCI,...

Post by MarkF » Sat 11 Jan 2014 13:52

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: LoadedOCI , FreeOCI,...

Post by AlexP » Sat 11 Jan 2014 14:36

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.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Re: LoadedOCI , FreeOCI,...

Post by MarkF » Sat 11 Jan 2014 19:35

Is it possible that you have an already fixed version? Mine prints false for every writeln in that test.

-Mark

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: LoadedOCI , FreeOCI,...

Post by AlexP » Mon 13 Jan 2014 09:55

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.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Re: LoadedOCI , FreeOCI,...

Post by MarkF » Mon 13 Jan 2014 13:57

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

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Re: LoadedOCI , FreeOCI,...

Post by MarkF » Mon 13 Jan 2014 15:23

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: LoadedOCI , FreeOCI,...

Post by AlexP » Mon 13 Jan 2014 15:38

Hello,

Thank you for the information. We have reproduced the problem when oraclient*.dll is absent and will fix it in the nearest build.

Post Reply