I'm having this error appearing quite often in my webpage. I use scope per request approach and I have also set Multithreaded option to True, but still this error occurs. What is the cause of this? Should I switch to domain model, could this help?
Sometimes I'm also getting following error:
I start new transaction in beginning of each request and commit it in end of request:
Thanks,
Robert
3 Answers, 1 is accepted
This might be caused by one of two things. Either you have a transaction commit somewhere in the code that is called prior to the EndRequest event being fired or the BeginRequest is not being fired (this can be caused by many things).
In order to fix the latter you have to not depend on the begin request for initializing your scope. You can either initialize in the pages or implement a custom HttpModule. We have a knowledge base article that describes how to do that. You can find it here. Please note that both the knowledge base article and code library are implemented using the new domain model approach. I will attach the code library implemented with the scope here. Note that you might have to update the references in the project in order to compile it.
I hope this helps. Please contact us back if you face further trouble.
Serge
the Telerik team

thanks for answer. The problem was caused by bad design. I tried to be too 'clever' and have created singleton class for data access. The static instance was shared between requests and the scope was overwritten with each request, resulting into parallel transactions and 'scope already diposed' errors.
This link helped me to realize what is wrong:
http://stackoverflow.com/
Hope it helps someone else.
Best regards,
Robert
Thank you for sharing this resource, we will take in into account when we face customers will similar issues.
I am glad you have resolved your issue. Do not hesitate to contact us back if you face further trouble.
Serge
the Telerik team