Oracle.ManagedDataAccessDTC.dll 使用

ODP.NET, Managed Driver Setup

This section explains the setup and configuration steps required for using distributed transactions with ODP.NET, Managed Driver.

Oracle recommends that applications use .NET's native managed distributed transaction implementation (default), which is available in .NET Framework 4.5.2 or higher. Applications can set whether .NET's native managed distributed transaction or Oracle.ManagedDataAccessDTC.dll is used by setting the UseManagedDTC parameter in the .NET configuration file. Follow these steps to configure distributed transactions in these .NET Framework versions:

  1. Create and setup the OraMTS recovery service or make sure an existing recovery service is running.

  2. Set the value of OMTSRECO_PORT in the .NET configuration to specify the port number that the OraMTS recovery service is running.

Alternatively, you can still use Oracle.ManagedDataAccessDTC.dll with .NET Framework 4.5.2 and managed ODP.NET. To do so, set UseManagedDTC to true and follow the instructions listed below for .NET Framework 4.5.1.

For .NET Framework 4.5.1 and lower applications, follow these steps to setup and configure managed ODP.NET for distributed instructions:

  1. Create and setup the OraMTS recovery service or make sure an existing recovery service is running.

  2. Deploy Oracle.ManagedDataAccessDTC.dll along with the application.

  3. Set the value of OMTSRECO_PORT in the .NET configuration to specify the port number that the OraMTS recovery service is running.

Oracle.ManagedDataAccessDTC.dll is included with ODP.NET, Managed Driver. This DLL makes unmanaged MSDTC COM calls to MSDTC, which means there is a 32-bit version and 64-bit version of this DLL. These two DLLs share the same name. If you are using 32-bit .NET Framework, then deploy the 32-bit Oracle.ManagedDataAccessDTC.dll. If you are using 64-bit .NET Framework, then deploy the 64-bit Oracle.ManagedDataAccessDTC.dll. The DLLs are located in the following directories:

  • For 32-bit .NET Framework: ORACLE_HOME\odp.net\managed\x86

  • For 64-bit .NET Framework: ORACLE_HOME\odp.net\managed\x64

Upon ODP.NET installation, Oracle.ManagedDataAccessDTC.dll is no longer placed into the Global Assembly Cache (GAC). For applications that use this DLL, Oracle.ManagedDataAccessDTC.dll must either be placed in the application directory or in the GAC.

Oracle.ManagedDataAccessDTC.dll should not be directly referenced by a .NET application. It will be implicitly loaded by ODP.NET, Managed Driver when using distributed transactions.

For applications with platform target x64 or x86 specifically, Oracle.ManagedDataAccess.dll will load Oracle.ManagedDataAccessDTC.dll appropriately if it is placed into the GAC or if it resides in the application directory.

For applications that target AnyCPU, the corresponding Oracle.ManagedDataAccessDTC.dll needs to be placed into x64 and x86 subdirectories under wherever the Oracle.ManagedDataAccess.dll is loaded from by the application. ODP.NET, Managed Driver will load the appropriate Oracle.ManagedDataAccessDTC.dll assembly (32-bit or 64-bit), based on whether the application is 32-bit or 64-bit. If both 32-bit and 64-bit versions of Oracle.ManagedDataAccessDTC.dll are in the GAC, then the appropriate assemblies will be loaded automatically.

https://docs.oracle.com/cd/E63277_01/win.121/e63268/InstallDistributedTransaction.htm#ODPNT8172

posted @ 2016-09-23 19:16  jimcsharp  阅读(2077)  评论(0编辑  收藏  举报