web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error on update: LockManager requires a transaction. Transaction has not been started

(0) ShareShare
ReportReport
Posted on by

Heya,

I have started to get this error when updating contact.

it occurs alternately...

The only change I have made was to update the pre update plugin with some logic which encrypt a string using AES encryption.

Also, at the bottom of the trace log its says:

[Microsoft.Crm.Audit: Microsoft.Crm.AuditCreateUpdatePlugin]
[3f98ba77-2929-4e32-8d9d-70c82ec929bc: AuditCreateUpdatePlugin]

Any ideas whats that error means?

Thanks!

*This post is locked for comments

I have the same question (0)
  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Can you please provide the full details of the error? This portion of the trace does not give us the exception message.

  • Community Member Profile Picture
    on at

    Hi Aric, sure:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: LockManager requires a transaction. Transaction has not been started.Detail:

    <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance&quot; xmlns="schemas.microsoft.com/.../Contracts&quot;>

    <ActivityId>93fc9719-bf2b-4914-93cf-1919db3b9925</ActivityId>

    <ErrorCode>-2147220911</ErrorCode>

    <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

    <Message>LockManager requires a transaction. Transaction has not been started.</Message>

    <Timestamp>2017-08-11T14:01:57.1111188Z</Timestamp>

    <ExceptionRetriable>false</ExceptionRetriable>

    <ExceptionSource>SdkClient</ExceptionSource>

    <InnerFault>

    <ActivityId>93fc9719-bf2b-4914-93cf-1919db3b9925</ActivityId>

    <ErrorCode>-2147220911</ErrorCode>

    <ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

    <Message>LockManager requires a transaction. Transaction has not been started.</Message>

    <Timestamp>2017-08-11T14:01:57.1111188Z</Timestamp>

    <ExceptionRetriable>false</ExceptionRetriable>

    <ExceptionSource i:nil="true" />

    <InnerFault>

    <ActivityId>93fc9719-bf2b-4914-93cf-1919db3b9925</ActivityId>

    <ErrorCode>-2147220911</ErrorCode>

    <ErrorDetails xmlns:d4p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

    <Message>LockManager requires a transaction. Transaction has not been started.</Message>

    <Timestamp>2017-08-11T14:01:57.1111188Z</Timestamp>

    <ExceptionRetriable>false</ExceptionRetriable>

    <ExceptionSource i:nil="true" />

    <InnerFault i:nil="true" />

    <OriginalException i:nil="true" />

    <TraceText i:nil="true" />

    </InnerFault>

    <OriginalException i:nil="true" />

    <TraceText i:nil="true" />

    </InnerFault>

    <OriginalException>System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: LockManager requires a transaction. Transaction has not been started. (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault).

    at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext)

    at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)

    at Microsoft.Crm.Extensibility.InprocessServiceProxy.ExecuteCore(OrganizationRequest request)

    at Microsoft.Crm.Sandbox.SandboxSdkListener.ExecuteInternal(SandboxCallInfo callInfo, SandboxSdkContext requestContext, String operation, Byte[] serializedRequest, IExecutionContext context, String& primaryEntityName)

    at Microsoft.Crm.Sandbox.SandboxSdkListener.Execute(SandboxCallInfo callInfo, SandboxSdkContext requestContext, String operation, Byte[] serializedRequest)

    Original SdkErrors:

    </OriginalException>

    <TraceText>Entity Name: contact

    Record Guid: b314198d-c579-e711-813b-e0071b6ae051

    User Guid: 1ce7e31f-912d-e711-8110-e0071b6ac151

    Plugin Depth: 1

    [Microsoft.Crm.Audit: Microsoft.Crm.AuditCreateUpdatePlugin]

    [3f98ba77-2929-4e32-8d9d-70c82ec929bc: AuditCreateUpdatePlugin]

    </TraceText>

    </OrganizationServiceFault>

    Server stack trace:

    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)

    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:

    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

    at Microsoft.Crm.Sandbox.ISandboxHost.ExecuteAndReturnTraceInfo(SandboxCallInfo callInfo, SandboxPluginExecutionContext requestContext, Guid pluginAssemblyId, Int32 sourceHash, String assemblyName, Guid pluginTypeId, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, String assemblyContents, Boolean returnTraceInfo)

    at Microsoft.Crm.Sandbox.SandboxPlugin.Execute(SandboxClient client, SandboxCallTracker callTracker, IExecutionContext requestContext, String assemblyContents, Boolean returnTraceInfo)

    at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context)

  • Community Member Profile Picture
    on at

    I have disabled all the Audits yet it still occurs

    Also, I could isolate method which probably causing this error:

    public static string DecryptStringFromBytesByAes(byte[] cipherText, byte[] Key, byte[] IV)
    {
    if (cipherText == null || cipherText.Length <= 0)
    throw new ArgumentNullException("cipherText");
    if (Key == null || Key.Length <= 0)
    throw new ArgumentNullException("Key");
    if (IV == null || IV.Length <= 0)
    throw new ArgumentNullException("IV");

    string plaintext = null;

    using (Aes aesAlg = Aes.Create())
    {
    aesAlg.Key = Key;
    aesAlg.IV = IV;

    ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);

    using (MemoryStream msDecrypt = new MemoryStream(cipherText))
    {
    using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
    {
    using (StreamReader srDecrypt = new StreamReader(csDecrypt))
    {

    plaintext = srDecrypt.ReadToEnd();
    }
    }
    }

    }

    return plaintext;
    }

  • Community Member Profile Picture
    on at

    Ever found the resolution . Seeing the Same Error

  • Suggested answer
    Ali Bajwa Profile Picture
    100 on at

    Hi Dear,

    I was facing same issue while working on update plugin. This has been fixed for me. I was updating entity object in plugin which was registered on Pre-Operation which is not right. So if you are doing such kind of thing then you gonna face such issue.

    Check your plugin code i don't think its from CRM side. Its our blunder which is causing this error.

    Cheers!

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at

    In the plugin execution pipeline, pre-validation does happen within the database transaction. The begin transaction should only happen after this stage. It looks like somehow some custom code is trying to perform an operation that requires a lock on the record but the lock cannot be acquired at that point and it's too early for that at that point.

    In simple terms, a Create/Update/Delete operation is most likely being performed in a Pre-validation stage.

    Please see the following if you would like to read more about the execution pipeline

    8512.ScreenClip-_5B00_59_5D00_.png#

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/event-execution-pipeline

    Hope this helps

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans