This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I am using Lightspeed 4 Pro for quite a while. Recently I've had to create a WCF service using Lightspeed but I am having trouble with it. First, the usual PerRequestUnitOfWorkScope Now, what kind of scope class should I use instead? I've tried to create my own implementation of UnitOfWorkScopeBase Any help is appreciated. |
|
|
That's the way I instantiate context. It's done in HttpApplication. Last thing I've tried is using SimpleUnitOfWorkScope. Scope is created in service instance below.
The problem with this solution is that doesn't exactly dispose unit of work and Oracle (underlying DB) connections multiply by each WCF request. If I put PerRequestUnitOfWorkScope in place of SimpleUnitOfWorkScope I get null reference exception when trying to use _scopeHolder.Current. |
|
|
Ok, I've found the solution and I'll post it here for others. PerRequestUnitOfWorkScope can work in WCF service. You need to do the following.
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] After that, PerRequestUnitOfWorkScope is working correctly and you can use the usual strategy as dealing with ASP.Net WebForms application (User Guide). Regards, Milivoj |
|