Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ODP.NET for both 32bit and 64bit

I am developing application which uses ODP.NET to connect to Oracle DB. I would like to have one version for both 32bit and 64bit machines. The problem is that I couldn't figure out how to build projetc with anycpu target, seems it requires the target to be the same as ODP driver version. So it means that I need to have to versions of the same application one for 32bit and other for 64bit. But the same was not problem while using MS .NET Oracle client (System.Data.OracleClient). Is there a way to have the same behavior using ODP.NET as on MS .NET client?

like image 223
NDeveloper Avatar asked Aug 05 '11 17:08

NDeveloper


People also ask

Does ODP support 32-bit or 64-bit?

Theoretically, ODP.NET could detect the "bit-ness" of the current execution in the .NET code and then dynamically load either 32-bit or 64-bit native DLLs accordingly, but that's not how it is currently implemented. Oracle corporation is currently in the process of implementing a fully managed provider.

What is the difference between ODP core and ODP managed driver?

ODP.NET Core is designed for multi-platform .NET (Core) applications. ODP.NET, Managed Driver is 100% managed code .NET Framework provider. Developers deploy a single assembly in a deployment package smaller than 10 MB. ODP.NET, Unmanaged Driver is the traditional Oracle ADO.NET provider that uses the Oracle Database Client.

What is ODP net in Oracle?

Oracle Data Provider for.NET (ODP.NET) features optimized ADO.NET data access to the Oracle database. ODP.NET allows developers to take advantage of advanced Oracle database functionality, including Real Application Clusters, self-tuning statement cache, Application Continuity, and Fast Connection Failover.

What are the different types of ODP drivers?

There are three driver types: ODP.NET Core; ODP.NET, Managed Driver; and ODP.NET, Unmanaged Driver. ODP.NET Core is designed for multi-platform .NET (Core) applications. ODP.NET, Managed Driver is 100% managed code .NET Framework provider. Developers deploy a single assembly in a deployment package smaller than 10 MB.


3 Answers

Just update few years later: Oracle released managed ODP.NET client, so there's no need to bother with x64/x86 in .NET applications any more. You can find more information on Oracle website: http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

like image 66
Buthrakaur Avatar answered Oct 09 '22 13:10

Buthrakaur


The root cause is the ODP.NET's reliance on native OCI DLLs, which of course cannot be "Any CPU".

Theoretically, ODP.NET could detect the "bit-ness" of the current execution in the .NET code and then dynamically load either 32-bit or 64-bit native DLLs accordingly, but that's not how it is currently implemented.

Oracle corporation is currently in the process of implementing a fully managed provider. But until then, we are stuck with having to do separate builds for each "bit-ness".

like image 23
Branko Dimitrijevic Avatar answered Oct 09 '22 13:10

Branko Dimitrijevic


The default option for any C# project is it will work on both x64 and x86 operating systems.

So it means that I need to have to versions of the same application one for 32bit and other for 64bit. But the same was not problem while using MS .NET Oracle client (System.Data.OracleClient).

This is expected....You need to release a x86 version and a x64 version, please take note, x86 application cannot reference a x64 assembly and vice-versa.

The reason the Microsoft reference was different was because its part of the .NET Framework by default.

I cannot download the file where I am at, I do believe that, ODP.NET has a x86 assembly and a x64 assembly.

The correct way is to release a x86 version and a x64 version of your program.

like image 33
Security Hound Avatar answered Oct 09 '22 12:10

Security Hound