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
I'm currently adding fulfilment of PurchaseOrders inside EPiServer Commerce using an EPiServer Job (JobBase). This works fine but I'm running into a small problem with the TransactionScope.
The functional idea is as follows:
Start transaction
Update shipment status to "Shipped"
Accept shipment changes
Update order status to "Completed"
Accept order changes
Send order to fulfilment provider
Commit transaction
Seeing as I can't cancel the fulfilment, I want to make sure the order can be saved before fulfilling the order. The idea behind the transaction is that any failures during these steps result in a full rollback.
Now I've tried both Mediachase.Data.Provider.TransactionScope and SqlContext.Current.BeginTransaction, but both result in data being commited to the database without ever accepting the transaction (e.g. without calling Complete/Commit).
Am I doing something wrong? Is it even possible to wrap AcceptChanges in a transaction? If it is, which transaction class is required?
Regards, Jerremy