views:

231

answers:

2

I am getting this error whenever my S#arp Architecture attempts to start and this is an problem with SQL Server (for example: SQL Server is not runing), after I start SQL Server and hit refresh, I get this error:

A storage mechanism has already been configured for this application

+3  A: 

NHibernateSession.Init() or InitStorage() is being called more than once. You're probably calling it every request, it's supposed to be called only once at startup.

Mauricio Scheffer
+1  A: 

Try to add this line before calling NHibernateSession.Init() to clear any previous initiation.

try{ NHibernateSession.Reset(); } catch { }

-1 for swallowing exceptions and recommending initializating multiple times.
Mauricio Scheffer
s/initializating/initializing
Mauricio Scheffer