Hi,
I've added a scheduled task to nopCommerce 1.9 and I got the following error:
System.Data.EntityException: An error occurred while starting a transaction on the provider connection. See the inner exception for details. ---> System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session.
To implement my data layer, I added new entities to the nopCommerce model, and wrote a service and entity following the same pattern as nop itself. My NopObjectContent is retrieved from Unity using the IoC.Resolve method.
On reading up on this, it appears that this occurs because I am using the same NopObjectContext instance on two threads.
I'm going to recode to ensure that I instantiate a different context for my Task, but 'long story short' my question is:
How does NopCommerce 1.9 get around the fact that it's own Scheduled Tasks could crash and burn in the same manner?
I just can't find how it protects against this eventuality, is it written in such a way that we hope that it never clashes, based on rarity of occurance etc?
Thanks for your help.
Mark Rabjohn
Integrated Arts Ltd