.Net Framework Data Provider error 60
Asked Answered
A

0

6

I've received the following error from the live site:

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: Internal .Net Framework Data Provider error 60. at System.Data.SqlClient.SqlDelegatedTransaction.Initialize() at System.Transactions.TransactionStatePSPEOperation.PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification) at System.Transactions.TransactionStateActive.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction) at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification) at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) ...

Locally I cannot reproduce it. I don't get such errors every day but I need to understand and fix it. From the logs I see that the piece of code where it happaned is:

           var transactionOptions = new System.Transactions.TransactionOptions();
           transactionOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted;

           using (var transactionScope = new System.Transactions.TransactionScope(System.Transactions.TransactionScopeOption.Required, transactionOptions))
            {
                this.DataContext = new BMDataContext();// DataContext;
                if (patientAdmissionID != -1)
                {
                    PatientAdmission admission = queryAdmission(this.DataContext, patientAdmissionID);

                    transactionScope.Complete();
                    return admission;
                }
                transactionScope.Complete();
                return null;
            }

The method calls queryAdmission that returns data from DB using linq to sql:

private static Func<BMDataContext, long, PatientAdmission> queryAdmission = System.Data.Linq.CompiledQuery.Compile(
               (BMDataContext context, long Id) => context.PatientAdmissions.FirstOrDefault(w => w.Id == Id));

Does anybody can help me with this error - ".Net Framework Data Provider error 60." ?

Addend answered 13/11, 2015 at 13:54 Comment(1)
I have the same problem. Did you find any solution?Givens

© 2022 - 2024 — McMap. All rights reserved.