IMO, best practice is to have the WCF service & the website completely separated (just my opinion, of course); equally, I think that using ASP.NET session from WCF is an anti-pattern. That said, there's no inherent reason why doing those things is going to cause an immediate problem/hang. Without knowing how you've set things up I can't do anything other than guess as to the problem, but 'gut feel' makes me suspect an ISession handling problem. What's your stratagem for session provision/maintenance? Have you verified that (1) sessions are being dispose'd of at the right points in time, and (2) that transactions aren't being left dangling? Do you have any threading constructs that could cause a deadlock? What does SQL Profiler show?
In order to give any more help, it'd be very useful to have a concise description of your setup e.g. whether you're using the 'session-per-request' pattern or something else, are you using DI, what's the ASP.NET session used for, etc… /Pete From: [email protected] [mailto:[email protected]] On Behalf Of Ian Harden Sent: 23 January 2014 22:24 To: [email protected] Subject: Re: [nhusers] Re: Using NHibernate with MVC 3 and WCF Sorry for being so confusing. What are the best practices for having a WCF service in the same pool as the website. What is happening is that the website gets hung up on a NHibernate request. What we think is happening is that the website is getting a session from WCF and not handling it correctly. I'm going through and adding more logging since we aren't getting any errors really when it does this, the website just becomes unresponsive. The Website never experienced this till we set up the services and turned on comparability mode. None of the calls in NHibernate changed. On Wednesday, January 22, 2014 10:25:03 AM UTC-7, PeteA wrote: It's impossible to give any advice without knowing what the issue is! In what way does the site "hang"? What makes you suspect that it's NHibernate related? /Pete From: [email protected] <javascript:> [mailto:[email protected] <javascript:> ] On Behalf Of Ian Harden Sent: 22 January 2014 16:00 To: [email protected] <javascript:> Subject: [nhusers] Re: Using NHibernate with MVC 3 and WCF On Tuesday, January 21, 2014 9:55:03 AM UTC-7, Ian Harden wrote: We have a WCF service that runs on the same server as the web site. We had to turn on aspNetCompatibilityEnabled to get at the HttpContext, we had to turn this on because the services use the same functions as the website to save and retrieve data. The problem is that since we have added the services the site hangs up every few days now. Are there any recommendations to solve this issue? As a worst case we could break them apart but since they are doing the same thing I would like to leave them as is if possible. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <javascript:> . To post to this group, send email to [email protected] <javascript:> . Visit this group at http://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/groups/opt_out.
