Developer forum

Forum » Ecommerce - Standard features » Exception when adding to cart

Exception when adding to cart

Mark Preisler
Reply

Hi

Occasionally, users are met with this exception, “this sqltransaction has completed it is no longer usable” have tried to google it, and read that it may be due to the fact that several times in row the Rollback method I called on a transaction.

https://stackoverflow.com/a/6359095

Upon closer look in the DW source code I can see that it might be true, that the rollback is called more than once.

In Dynamicweb.Data.DataManager.CreateDataSet, CreateDataSet is called and both methods is calling Rollback on the same transaction when an exception thrown.

Capture10.PNG Capture11.PNG Capture9.jpg

Replies

 
Nicolai Pedersen
Reply

Hi Mark

You maybe have a point there.

But - that particular exception would only come if there is a rollback on the transaction of the orderline.save command - which happens only if there is another exception... Which again we cannot see because of this.

Question is - why is there an underlying exception at all - could it come from something custom - redundancy maybe?

Will have a dev look into the exception and transaction handling here.

BR Nicolai

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Mark,

I've looked into this, and I agree that there is some strangeness when it comes to how DataManager handles transactions. However, this class is being phased out in favor of using the Dynamicweb.Data.Database API instead. We're not quite there yet, but with the exception of OrderLineRepository, there are no further usages of DataManager with the transaction flag set to true.

This specific issue has been fixed as part of a bigger code change in 9.7, but we'll discuss internally whether it would be feasible to merge the change -- or parts of it -- to 9.6.

- Jeppe

 
Mark Preisler
Reply

Hey Nicolai and Jeppe

 

Thanks for the quick reply. There is an underlying error, that is the one I am a looking for, but right now it is hard to see what it is, as it is masked by this other error.

I will be waiting for future releases to correct the error.

 

Thanks 

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Mark

An update for this problem is now available in version 9.6.14

To upgrade please choose this version from download:

http://doc.dynamicweb.com/releases-and-downloads/releases

Let me know if you need any more help regarding this

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 
Mark Preisler
Reply

Thanks.

 

You must be logged in to post in the forum