Well, StructureMap is building an ISessionSource instance actually...

Then my module, on BeginRequest, calls gets an instance of an
encapsulating class I use called NHibernateUnitOfWork, and calls an
initialize function that calls CreateSession on the SessionSource and
manages the transactions per request to it. The way I'm reading this,
a session shouldn't ever be instantiated until the Request is made...
which may be the case... this error may actually be StructureMap
catching the SQL timeout exception from the ISessionSource timing out
when trying to create the session at CreateSession().... Such sessions
should always be disposed at the end of a request though...

Again, this only occurs when I rebuild the application, and then only
the first few times I try to hit it... I'm leaning toward there being
a hanging connection to the SQL server that's tied to the old build,
and the new one has to wait until that hanging connection times out
before it will allow the new one to make a connection... I'm just not
sure why it would be hanging from my current setup... and I don't know
where to look to figure this out.

/ Michael /

On Feb 13, 3:26 pm, Jason Meckley <[email protected]> wrote:
> you setup the session or session factory in application start? you
> should be creating the session factory in the application start.
> sessions should be scoped to each request which can be managed by the
> http module.
> Are you issuing any queries on application start? if so are they
> efficient queries? how much data is being retrieved?
>
> On Feb 13, 12:16 pm, Beefy <[email protected]> wrote:
>
>
>
> > I have a web app that uses Fluent NHibernate and StructureMap for IoC.
> > I have an issue where upon some builds of the app, the first few times
> > I hit the web site I will get a SQL connection timeout error. After
> > those first two or three times, everything is fine. The ISession is
> > being setup by StructureMap at Application_Start time. I then have an
> > HttpModule that handles all session commits, etc. The build seems to
> > (sometimes, not all times) trigger a hanging connection or something
> > that has to time out before the new build of the web app can establish
> > a connection.
>
> > Does anyone have a minute to shed some light on my issue for me so
> > that I can avoid this problem on new deployments of the app in the
> > future?
>
> > / Michael /

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to