Version 9.2.7 and Can't initialize OCI error (-1)

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Version 9.2.7 and Can't initialize OCI error (-1)

Post by MarkF » Tue 25 Feb 2014 16:23

As mentioned in my post under the "OCI function is not linked" thread, I still get the above error even with the 9.2.7 fixes. This is with the Oracle 10.1.0.4.0 client. I've verified that I can use it with an earlier version of my program, which was built with an older version of ODAC (however I'm not positive what version it was, but it was before the new Oracle Home's related changes.) I have no problems with newer Oracle Clients. Thanks for any help.

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

Re: Version 9.2.7 and Can't initialize OCI error (-1)

Post by MarkF » Tue 25 Feb 2014 18:44

I just wanted to add that this test is done with the oldest (10.1) Oracle Instant Client version that Oracle makes available on its downloads page. I've verified that the home works and can connect both with SQLPlus and with an older version of ODAC, but gives the "Can not initialize OCI (-1)" error with Odac 9.2.7.

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

Re: Version 9.2.7 and Can't initialize OCI error (-1)

Post by AlexP » Wed 26 Feb 2014 10:24

hello,

We cannot reproduce the problem on the latest ODAC version 9.2.7 and Oracle instant Client 10.1.0.4.0. After unpacking the archive, adding the following record to the registry and adding the path to the client to the PATH variable - connection is established correctly:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraClient10g_home1]
"ORACLE_HOME"="D:\\instantclient10_1"
"ORACLE_HOME_NAME"="OraClient10g_home1"
"ORACLE_GROUP_NAME"="Oracle - OraClient10g_home1"
"NLS_LANG"="RUSSIAN_CIS.CL8MSWIN1251"
"ORACLE_HOME_KEY"="SOFTWARE\\ORACLE\\KEY_OraClient10g_home1"

Try to reinstall ODAC with the /force option.

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

Re: Version 9.2.7 and Can't initialize OCI error (-1)

Post by MarkF » Wed 26 Feb 2014 13:57

Thanks for the suggestion as that allowed me to figure out what was wrong. It turns out you've changed the LoadLibrary calls in OraCall to not use LOAD_WITH_ALTERED_SEARCH_PATH in some cases. It appears that Oracle Clients newer than 10 can handle finding their own dlls without that, but the older client can't (when the client is not in the system path.) I'd be interested as to why you'd ever not use LOAD_WITH_ALTERED_SEARCH_PATH? It's possible that it's just a bug as I see that you are checking to see if the dll contains a path first (and then choosing the wrong option?) In any case, I've got it fixed, so thanks for your help.

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

Re: Version 9.2.7 and Can't initialize OCI error (-1)

Post by AlexP » Thu 27 Feb 2014 09:58

LOAD_WITH_ALTERED_SEARCH_PATH is used in case if it is impossible to find the record about the Oracle client and define where it is installed. We will investigate the behavior of the old clients and add the required changes.

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

Re: Version 9.2.7 and Can't initialize OCI error (-1)

Post by MarkF » Thu 27 Feb 2014 12:05

Thanks for the explanation. Note that the issue only comes up if the client is not in the system path, so it's a fairly minor issue.

-Mark

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

Re: Version 9.2.7 and Can't initialize OCI error (-1)

Post by AlexP » Fri 28 Feb 2014 11:06

As I wrote earlier, we will consider the possibility to change this behavior

Post Reply