Hi,
On a system with 32 bit 11g oracle client AND 64 bit 11g oracle client installed (using different homes) it is possible to run assemblies in x86 or x64 Mode on the same system, both connecting to an oracle database.
For that the ADO.Net provider does have to find the right oracle client. System.Data.OracleClient can do that. I guess its looking the oracle home up in the registry and is automatically redirected to the Wow6432Node when running in 32 bit mode. The 'wrong' way would be to depend on environment variables like PATH which are the same for 32 and 64bit applications.
dotConnect for Oracle 5.70.190.0 does only find the client that has been installed last, so i assume its using the environment variables.
It would be really helpful if you could implement a better oracle client lookup for systems with both 32 and 64 bit oracle clients installed.
Thanks and with kind regards
Bernhard
Find the right Oracle Client for both x86 and x64.
-
- Posts: 5
- Joined: Wed 24 Nov 2010 14:52
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
-
- Posts: 5
- Joined: Wed 24 Nov 2010 14:52
I've just found a that if you assign a Oracle home name to the OracleConnection.Home property, the connection will choose the right version, even if a home with the same name exists in both x86 and x64.
So its something like this:
This is a useful workaround for the time being.
Bernhard.
So its something like this:
Code: Select all
var oracleKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE").OpenSubKey("ORACLE");
string home = (string)oracleKey.OpenSubKey(oracleKey.GetSubKeyNames()[0]).GetValue("ORACLE_HOME_NAME");
connection.Home=home;
connection.Open();
Bernhard.
New build of dotConnect for Oracle 6.50.237 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=22379 .
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=22379 .
Thanks for letting us know Pondok Cerita about this useful stuff!