Cannot enlist in the transaction because a local transaction is in progress on the connection
Had the above error occur in a FIM lab environment today, for FIM version 4.0.3561.2. This occurred when I included 3 parallel workflow action activities in the same request-based MPR, all 3 of them to generate a pair of nested groups in the FIM
portal. In this case one of the workflows succeeded and the other 2 failed with this error.
This MPR has been fully tested and deployed to a UAT environment, and I only stumbled on this while preparing a training video back in DEV. I am not getting this problem in any other environment ... YET! :)
Below is the full stack trace:
System.InvalidOperationException: Cannot enlist in the transaction because a local transaction is in progress on the connection. Finish local transaction and retry. at System.Data.SqlClient.SqlInternalConnection.EnlistTransaction(Transaction
transaction) at System.Data.SqlClient.SqlConnection.EnlistTransaction(Transaction transaction) at Microsoft.ResourceManagement.Data.TransactionAndConnectionScope..ctor(Boolean createTransaction, IsolationLevel isolationLevel, DataStore dataStore) at Microsoft.ResourceManagement.Data.TransactionAndConnectionScope..ctor(Boolean
createTransaction) at Microsoft.ResourceManagement.Data.DataAccess.UpdateRequest(RequestType request, IEnumerable`1 updates) at Microsoft.ResourceManagement.WebServices.RequestDispatcher.UpdateRequestAndPersist(RequestType request) at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.DispatchRequest[TResponseType](RequestType
request) at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessCreateWorkItem(CreateRequestWorkItem createWorkItem) at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessWorkItem(WorkItem workItem)
Has anyone seen this problem before?
I restarted the FIM service and it rolled back the requests that were still marked with a "validating" status. I then retried ... and this time 2 of the 3 activities succeeded, but the 3rd failed with this SQL timeout error:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at Microsoft.ResourceManagement.WebServices.RequestDispatcher.CreateRequest(CreateRequestDispatchParameter
dispatchParameter) at Microsoft.ResourceManagement.WebServices.RequestDispatcher.CreateRequest(UniqueIdentifier requestor, UniqueIdentifier targetIdentifier, OperationType operation, String businessJustification, List`1 requestParameters, CultureInfo locale,
Boolean isChildRequest, Guid cause, Boolean doEvaluation, Nullable`1 serviceId, Nullable`1 servicePartitionId) at Microsoft.ResourceManagement.WebServices.RequestDispatcher.CreateRequest(UniqueIdentifier requestor, UniqueIdentifier targetIdentifier, OperationType
operation, String businessJustification, List`1 requestParameters, CultureInfo locale, Boolean isChildRequest, Guid cause) at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.CreateRequest(UniqueIdentifier requestor, UniqueIdentifier
objectId, OperationType operation, List`1 requestParameters, Guid parentRequest) at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessCreateWorkItem(CreateRequestWorkItem createWorkItem) at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessWorkItem(WorkItem
workItem)
This time I restarted the SQL service and (after again restarting FIM) I managed to get all 3 workflow activities to succeed.
My real question is this ... is the problem because I am violating some sort of best practice, or is it more likely to do with degradation of the Lab environment and the need to do SQL maintenance on the FIM db (e.g. full text index rebuilds, etc.). If so,
what should be the mitigation strategy for a production environment?
TIABob Bradley, www.unifysolutions.net (FIMBob?)
February 16th, 2011 10:11pm