Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
GA.Web.UI.Global.Session_Start(Object sender, EventArgs e)
is this your code? Can you post it here?
Hi Quan,
I wasn't able to post all the code. But It's okay, I was able to solve the problem :)
I understand that this error can happen if you create two new carts for a user and attempt to save them both... I located a spot in our code where this could potentially be happening... so I refactored it accordingly - and haven't gotten this error since.
Thanks,
- Ken
I am seeing this error in my logs:
..
Message: Mediachase.Commerce.Orders.Exceptions.OrderException: A cart with same CustomerId, Name, and MarketId already exist. Creating duplicated cart is not allowed
at Mediachase.Commerce.Storage.MetaStorageBase.ProcessInsertUpdateResults(DataResult result)
at Mediachase.Commerce.Storage.MetaStorageBase.AcceptChanges(MetaDataContext context, Boolean saveSystem)
at Mediachase.Commerce.Orders.OrderGroup.AcceptChanges()
at Mediachase.Commerce.Orders.Cart.AcceptChanges()
at GA.Web.UI.Global.Session_Start(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.SessionState.SessionStateModule.CompleteAcquireState()
at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
...
I notice that it is coming from Session_Start. The error seems to show that Session_Start is calling Cart.AcceptChanges() directly. But this surprises me, because I do not directly call Cart.AcceptChanges().
(I DO have some other objects in Session_Start that can indirectly call Cart.AcceptChanges() through nested function calls.. but, the stack trace shows that Cart.AcceptChanges() is being called directly.)
So I'm a bit confused about what could be happening here.. any ideas?
EDIT:
I'm using EPiServer Commerce Framework
Version: 9.24 (build: 1)