November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
nothing special about my code:
var cart = OrderContext.Current.GetCart(request.CartName, userId);
cart.SaveAsPurchaseOrder(); // error occurs here
cart.AcceptChanges();
I don't think you have to call cart.AcceptChanges() here. When you call SaveAsPurchaseOrder(), you're creating an purchase order and saving it. the cart now can be discarded.
The code should be
var order = cart.SaveAsPurchaseOrder();
//work with order from here.
Regards.
/Q
thanks for pointing this out. but my error is occurring when i call
SaveAsPurchaseOrder()
do i have set\configure anything in the cart before i can convert it to an order? please exacue my simple qustions, i am new to episerver commerce.
at System.Data.SqlClient.SqlInternalConnectionTds.CheckEnlistedTransactionBinding()
at System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj, Boolean isDelegateControlRequest)
at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
at System.Data.SqlClient.SqlInternalTransaction.Rollback()
at System.Data.SqlClient.SqlTransaction.Rollback()
at Mediachase.Data.Provider.TransactionScope.ThreadStaticTransactionScope.Dispose()
at Mediachase.Data.Provider.TransactionScope.Dispose(Boolean disposing)
at Mediachase.Data.Provider.TransactionScope.Dispose() at Mediachase.Commerce.Orders.Cart.SaveAsPurchaseOrder()
at MyProjectMarketing.Business.ServiceBus.OrdersSystemProcessor.CheckoutCompleteOrder(CheckoutCompleteOrderRequest request)
It looks like the issue is in your database itself, instead of the code.
I would suggest to check the database performance, it looks like the hardware it's running on is being slow (out of memory, out of hard disk, fragment hard disk ...).
Regards.
/Q
Hi All,
All I am doing is calling the method SaveAsPurchaseOrder then accept changes, i decompiled the code and copy paste it so i can step into it, and i found the exception is thrown on the line:
in my cart i have two line items with different skus, and no payment info, nor address info.
the exception message:
some says it is a timeout issue, so i configured my machine.config file to increase the maxtimeout
I am not sure what I should do to make it working.
Please help.
Thanks