Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Error

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
toyman
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 05.01.2010, 16:27

Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Error

Post by toyman »

After updateing my XE2 to Update 4 I no longer can connect with Oracle databases of my client. Anytime I try to connect, I have got error message:

None of the dynamic libraries can be found or is not loadable: oci.dll !
Use TZConnection.LibraryLocation if the location is invalid

Of course - I have put valid path+file name into LibraryPath, copied oci.dll into win32/debur directory, modified PATH environment variable - nothing helps, putted oci.dll into system/system32 in windows directory. Tryed to reinstal operating system - ZEOS works perfectly until Update 4 od XE2 has been installed.

Everything works perfectly at this computer on Delphi 7 + ZEOS 6.6.5-stable

Exactly the same problem occured on another two machines after updateing Delphi XE2 do Update 4, ale both have the same non-problemo on Delphi 7. Seems there is no matter which operating system I use - same problem on Vista, Win7

Problem with ZEOS 7.0.3-stable occures ONLY with Oracle database. Nothing wrong happends when using PostgreSQL, MySQL, MS SQL or SQLite databases

Has anyone any idea what should I check to correnct this strange behavior ?
Last edited by toyman on 28.09.2013, 20:23, edited 1 time in total.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE2, ZEOD 7.0.3-stable and Oracle Connection Erro

Post by EgonHugeist »

Imho, don't you need to copy the oci.dll since Oracle expects some more libs.

Just use TZConnection.LibraryLocation := 'Your OCI path\oci.dll'.

May i ask for your compile target? Did you have the expected (32 or 64Bit) client installed? I think you're using the W64 target now..
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
toyman
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 05.01.2010, 16:27

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by toyman »

I have used wrong description.

Instead of
toyman wrote: Of course - I have put valid path+file name into LibraryPath
I should say
toyman wrote: Of course - I have put valid path+file name into LibraryLocation property in the ZConnection component
My target platform is Win32, and oracle client is also 32bit.

I have tested this on Vista 32bit machine, on Win7 64bit, and fresh insallation of Win7 64bit - everytime everything works perfectly until applying Update 4 for Delphi XE2 (need that update because of one of the key component, that requires it) - after that oracle connection via ZEOS stops working.

EDIT:

I have to apologize - after putting proper oci.dll location in LibraryLocation property - error message have changed to: "OCI_ERROR: "

I have done some basic debugging (which I dropped since Delphi 7 did not have such problems), but I have stopped at TZOracleConnection.Open method, which calls GetPlainDriver.EnvNlsCreate method that returns Status=-1. Then CheckOracleError displays error dialog.

EnvNlsCreate method calls low level API function: OracleAPI.OCIEnvNlsCreate but there I have stopped. I have found Oracle API documentation for this function:
http://docs.oracle.com/cd/B10501_01/app ... i15re6.htm ,but my English is't good enough to understand what is wrong with that.
Last edited by toyman on 28.09.2013, 20:23, edited 1 time in total.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE2, ZEOD 7.0.3-stable and Oracle Connection Erro

Post by EgonHugeist »

Did check 7.0.3.

Loading multiple dll's lice oci or postgres isn't supported with 7.0.3.

Since 7.0.4 we support that.

ZPlainLoader.pas, change this function:

Code: Select all

function TZNativeLibraryLoader.ZLoadLibrary(Location: String): Boolean;
var newpath, temp: String; // AB modif
begin
  if FLoaded then
    Self.FreeNativeLibrary;
  temp := ''; //init for FPC
  FLoaded := False;
  Result := False;
  newpath := ExtractFilePath(Location);
  // AB modif BEGIN
  try
   if newpath <> '' then begin
     temp := GetCurrentDir;
     SetCurrentDir(newpath);
   end;
  // AB modif END

{$IFDEF UNIX}
  {$IFDEF FPC}
    FHandle := LoadLibrary(PAnsiChar(Location));
  {$ELSE}
    FHandle := HMODULE(dlopen(PAnsiChar(Location), RTLD_GLOBAL));
  {$ENDIF}
{$ELSE}
  FHandle := LoadLibrary(PChar(Location));
{$ENDIF}

  // AB modif BEGIN
  finally
   if temp<>'' then
     SetCurrentDir(temp);
  end;
  // AB modif END
  if (FHandle <> INVALID_HANDLE_VALUE) and (FHandle <> 0) then
  begin
    FLoaded := True;
    FCurrentLocation := Location;
    Result := True;
  end;
end;
and it should work than.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
toyman
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 05.01.2010, 16:27

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by toyman »

Thank You for Your time - did't expect any reaction ;)

I have commented old version of ZLoadLibrary function, and inserted Your version. After rebuilding - Error message did not disappeard and did not changed - it still says: "SQL Error: OCI_ERROR: "

After debugging ZLoadLibrary variables got following values:

FLoaded = TRUE
temp = <path_to_debug_folder_of_my_test_project>
Result = TRUE
newpath = D:\oracle\product\10.2.0\client_2\bin\
Location = D:\oracle\product\10.2.0\client_2\bin\oci.dll
Fhandle = 268435456
FCurrentLocation = D:\oracle\product\10.2.0\client_2\bin\oci.dll

so - it seems library is loaded, but GetPlainDriver.EnvNlsCreate(FHandle, OCI_OBJECT, nil, nil, nil, nil, 0, nil, OCI_CLIENT_CHARSET_ID, OCI_CLIENT_CHARSET_ID); function called inside TZOracleConnection.Open (ZDbcOracle.pas) function still returns value = -1

FHandle before and after executing this function has value = nil
OCI_OBIECT of course is constant with value =2
OCI_CLIENT_CHARSET_ID have value = 0
OCI_CLIENT_CHARSET_ID also have value = 0
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by EgonHugeist »

Grumble,

may i ask if you use TCurrencyFields somewhere? If so we had a nice longstanding stack-killer in our sources. Fixed since 7.0.4.

Btw. 7.0.6 is released. You can download it on SourceForge.net.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
toyman
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 05.01.2010, 16:27

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by toyman »

No. I'm not using TCurrencyFields.

Today I have moved to 7.1.1-rc (TZConnection.Version property says: 7.0.3-beta - I was unable to find 7.0.6 on sourceforge) and ... nothing changed. Still got OCI_ERROR

As I say - ZEOS 6.6.5-stable works on the same environment (on Delphi 7. The same machine where Delphi XE2 Update 4 is installed - on every machine with that setup) perfectly without any unexpected behaviors and errors. Byt I cannot use Delphi 7 with new project.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by EgonHugeist »

Uh i'm sorry. 7.0.6 was staged for some days and is available now.

But i don't expect any changes in this domain. I have NO problems with oracle.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
toyman
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 05.01.2010, 16:27

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by toyman »

I have't any problems with ZEOS and Oracle BEFORE installation Update 4 for Delphi XE2.

Question: Do You have update 4 installed in Your XE2 environment ?
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by EgonHugeist »

Nope, I don't have a XE2 compiler or later. My XE is deprecated inbetween...

Mostly i use such by making a TeamViewer-Session. So i can help as long i can not verify the issues by my selves.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
toyman
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 05.01.2010, 16:27

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by toyman »

In my case TeamViever session is not an option - I work with Oracle database via VPN, which is configurad to disable any other communication - including LAN. I cannot disable this option - this is configured by other side.

But - You say if I let You look at my environment via TV - You can spend some of You time to try solve this problem (assuming I can organize some local Oracle environment) ?
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by EgonHugeist »

I think so. Just prepare a local environment and i'll try my best...
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1962
Joined: 17.01.2011, 14:17

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by marsupilami »

Hello Michael,

I do have a Computer with Delphi XE2 installed. So if you want to, I could manage to grant access to it for solving this problem.
Best regards,

Jan
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by miab3 »

@toyman

Latest version of Delphi XE2 was Update 4 Hotfix 1.
http://edn.embarcadero.com/article/42282
That you use?
I had no problems with it and Oracle Database Express Edition 11g Release 2.

Michal
toyman
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 05.01.2010, 16:27

Re: Delphi XE2, ZEOS 7.0.3-stable and Oracle Connection Erro

Post by toyman »

I have only: Delphi XE2 and C++Builder XE2 Update 4 - in the Installed Updates section of About window.

Thanks for information. I'll try install hotfix 1 and we will see if it solve problem.
Post Reply