We have a .NET 4.8 WCF webservice, (CRUD)working with two different Oracle databases, in one transaction. This is a distributed transaction (because of multiple databases) and it’s managed through the MSDTC. The webservice executeing multiple tasks, therefor open several connections. When the number of the connections reach a certain number, the following exception occures:
„Oracle.ManagedDataAccess.Client.OracleException: 'Unable to enlist in a distributed transaction'”
at OracleInternal.MTS.MTSTxnRM.GetTxnBranch(ConnectionString cs, String dbInst)
source: Oracle Data Provider for .NET, Managed Driver
number: -1050
…
at OracleInternal.MTS.MTSTxnRM.GetTxnBranch(ConnectionString cs, String dbInst)
at OracleInternal.ConnectionPool.PoolManager`3.GetEnlisted(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleConnection connRefForCriteria)
…
This exception was originally thrown at this call stack:
OracleInternal.MTS.MTSTxnRM.GetTxnBranch(OracleInternal.ConnectionPool.ConnectionString, string)
OracleInternal.ConnectionPool.PoolManager<PM, CP, PR>.GetEnlisted(OracleInternal.ConnectionPool.ConnectionString, bool, Oracle.ManagedDataAccess.Client.OracleConnection)
OracleInternal.ConnectionPool.OracleConnectionDispenser<PM, CP, PR>.Get(OracleInternal.ConnectionPool.ConnectionString, PM, OracleInternal.ConnectionPool.ConnectionString, System.Security.SecureString, System.Security.SecureString, Oracle.ManagedDataAccess.Client.OracleConnection)
…
This exception was originally thrown at this call stack:
OracleInternal.MTS.MTSTxnRM.GetTxnBranch(OracleInternal.ConnectionPool.ConnectionString, string)
OracleInternal.ConnectionPool.PoolManager<PM, CP, PR>.GetEnlisted(OracleInternal.ConnectionPool.ConnectionString, bool, Oracle.ManagedDataAccess.Client.OracleConnection)
OracleInternal.ConnectionPool.OracleConnectionDispenser<PM, CP, PR>.Get(OracleInternal.ConnectionPool.ConnectionString, PM, OracleInternal.ConnectionPool.ConnectionString, System.Security.SecureString, System.Security.SecureString, Oracle.ManagedDataAccess.Client.OracleConnection)
Oracle.ManagedDataAccess.Client.OracleConnection.Open()
…
This exception was originally thrown at this call stack:
OracleInternal.MTS.MTSTxnRM.GetTxnBranch(OracleInternal.ConnectionPool.ConnectionString, string)
OracleInternal.ConnectionPool.PoolManager<PM, CP, PR>.GetEnlisted(OracleInternal.ConnectionPool.ConnectionString, bool, Oracle.ManagedDataAccess.Client.OracleConnection)
OracleInternal.ConnectionPool.OracleConnectionDispenser<PM, CP, PR>.Get(OracleInternal.ConnectionPool.ConnectionString, PM, OracleInternal.ConnectionPool.ConnectionString, System.Security.SecureString, System.Security.SecureString, Oracle.ManagedDataAccess.Client.OracleConnection)
Oracle.ManagedDataAccess.Client.OracleConnection.Open()
System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open.AnonymousMethod__13_0(System.Data.Common.DbConnection, System.Data.Entity.Infrastructure.Interception.DbConnectionInterceptionContext)
System.Data.Entity.Infrastructure.Interception.InternalDispatcher<TInterceptor>.Dispatch<TTarget, TInterceptionContext>(TTarget, System.Action<TTarget, TInterceptionContext>, TInterceptionContext, System.Action<TInterceptor, TTarget, TInterceptionContext>, System.Action<TInterceptor, TTarget, TInterceptionContext>)
System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(System.Data.Common.DbConnection, System.Data.Entity.Infrastructure.Interception.DbInterceptionContext)
System.Data.Entity.Core.EntityClient.EntityConnection.Open.AnonymousMethod__55_0()
System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute(System.Action)
System.Data.Entity.Core.EntityClient.EntityConnection.Open()
The error depends on the number of the tasks. With only a few tasks, the program works fine, the exception occures only when there are a lot of tasks to exceute in the trancation.
My question:
Is it possibble that this problem is depend on the number of the open connections? If yes, is there a maximum number of open connections that allowed, and what/where can control this behavior?
This error occures on the following platforms:
.net 4.8 WCF service
Oracle 19
ADO.NET + Entity framework 6.4.0
Oracle.ManagedDataAccess.19.11.0
Windows server 2016
Connection Pooling with default parameters
Transaction: The main transaction opening by wcf service, but there are points where calling oracle procedures in autonomus transaction.