Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Exception when using Transactions and Azure

Vote:
0

Hi,

I'm seeing this exception intermittently when using Transactions and Azure:

Server Error in '/' Application.

The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in thecode.
Exception Details: System.Runtime.InteropServices.COMException: The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)

[COMException (0x8004d024): The transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D024)]

System.Transactions.Oletx.IDtcProxyShimFactory.ReceiveTransaction(UInt32 propgationTokenSize, Byte[] propgationToken, IntPtr managedIdentifier, Guid& transactionIdentifier, OletxTransactionIsolationLevel& isolationLevel, ITransactionShim& transactionShim) +0
System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken) +315

Has enyone else experienced the same?

/Mark

#122582
Jun 05, 2015 14:30
Vote:
0

Hi,

What's the code you are using? I suspect you might have conflicted scopes of transaction.

/Q

#122584
Jun 05, 2015 15:00
Vote:
0

Hi Quan Mai,

Here's the piece of code:

using (var transactionScope = new TransactionScope())
{
  try
  {
    OrderGroupWorkflowManager.RunWorkflow(cart, OrderGroupWorkflowManager.CartCheckOutWorkflowName);
  }
  catch (Exception ex)
  {
    if (ex is PaymentException)
      throw;
    if (ex.InnerException is PaymentException)
      throw;
  }

// store customer information on cart
cart.CustomerName = CurrentContact.FullName;
cart.CustomerId = CurrentContact.PrimaryKeyId.Value;
cart.OrderForms[0].Payments[0].Status = response.AuthResult;
var purchaseOrder = cart.SaveAsPurchaseOrder();

// store latest order information on contact
CurrentContact.LastOrder = purchaseOrder.Created;
CurrentContact.SaveChanges();
purchaseOrder.Status = response.AuthResult;

AddNoteToPurchaseOrder("New order placed by {0} in {1} site", purchaseOrder,
CurrentContact != null ? CurrentContact.FullName : string.Empty, SiteDefinition.Current.Name);
purchaseOrder.AcceptChanges();

PurchaseOrderManager.UpdatePromotionUsage(cart, purchaseOrder);
//CmoGadgetController.IncreaseOrder(this.CartHelper.LineItems);

cart.Delete();
cart.AcceptChanges();
transactionScope.Complete();
}

#122585
Jun 05, 2015 15:03
Vote:
0

Hi,

Does this code work on local environment (Non-Azure)? And it's unlikely, but it should be Mediachase.Data.Provider.TransactionScope, not .NET TransactionScope.

/Q

#122586
Jun 05, 2015 15:10
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.