Page 1 of 1

EF4 and DevARt 8.4.389 random transaction exception

Posted: Tue 13 Feb 2018 18:12
by Dypsok
Hello,
I have a WCF C# web service (EF4 and devart driver for oracle 8.4.389.0) that is called each 5 secondes and do a lot of work : it hit the oracle 11g database to extract various informations.

and under heavyload I got this kind of error messages :

Code: Select all

system.data.entityexception : underlying provider failed on Open
---> System.Transactions.TransactionException: The operation is not valid for the state of the transaction. 
---> System.TimeoutException: Transaction Timeout
   --- End of inner exception stack trace ---
   at System.Transactions.TransactionState.EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
   at System.Transactions.Transaction.EnlistVolatile(IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
   at Devart.Common.DbConnectionInternal.EnlistToDistributedTransactionInternal(Transaction transaction)
   at Devart.Common.DbConnectionInternal.e()
   at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
   --- End of inner exception stack trace ---
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
   at System.Data.EntityClient.EntityConnection.Open()
   at System.Data.Objects.ObjectContext.EnsureConnection()
   at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1[TResult](IEnumerable`1 sequence)
   at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
   at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
   at BSServices.Catalog.GetProductInfo(String tenantId)
I have read a lot about transactions but not found any reason why my service is failing.
I have checked the MSDTC log on my web server and db server and I haven't found any trace about a distributed transaction. I have really no any clue about what is going on here. could you help me with the stacktrace or tell me where to search further?

Re: EF4 and DevARt 8.4.389 random transaction exception

Posted: Wed 14 Feb 2018 17:42
by Dypsok
Noone here could help me with my problem or give me some hint to what to search for ?

Re: EF4 and DevARt 8.4.389 random transaction exception

Posted: Thu 15 Feb 2018 15:52
by Shalex
Please upload a small test project with the corresponding DDL/DML script to ftp://ftp.devart.com (credentials: anonymous / yourEmail) so that we can reproduce the issue in our environment and investigate it.

Re: EF4 and DevARt 8.4.389 random transaction exception

Posted: Thu 15 Feb 2018 17:33
by Dypsok
I am sorry but I could not share the private code.
Is there any known reason why such an exception could be raise :

Code: Select all

   --- End of inner exception stack trace ---
   at System.Transactions.TransactionState.EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
   at System.Transactions.Transaction.EnlistVolatile(IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions)
   at Devart.Common.DbConnectionInternal.EnlistToDistributedTransactionInternal(Transaction transaction)
Thank you

Re: EF4 and DevARt 8.4.389 random transaction exception

Posted: Fri 16 Feb 2018 14:54
by Shalex
The error occurs in Microsoft's code in System.Transactions.Transaction.EnlistVolatile, so we cannot identify the reason of the issue.

Taking into account Transaction Timeout in your stack trace, we recommend you to look for a solution at:
* https://sankarsan.wordpress.com/2009/02 ... nsactions/
* https://blogs.msdn.microsoft.com/ajit/2 ... -the-code/