-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: "duplicate cache region" error on simultaneous req
PostPosted: Thu Aug 18, 2005 3:29 pm 
Regular
Regular

Joined: Fri May 13, 2005 4:08 pm
Posts: 64
Hey, I just realized that when my web app is just starting, and two requests hit the server at about the same time, NHibernate chokes with the below error. Can anyone tell me what's going wrong, and/or what other info I should provide?


Server Error in '/Web' Application.
duplicate cache region
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.MappingException: duplicate cache region

Source Error:

Line 31: {
Line 32: if (factory == null)
Line 33: factory = Config.BuildSessionFactory();
Line 34: return factory;
Line 35: }


Source File: C:\wc\RDAS\MyNHibernateContrib\DbMgr.cs Line: 33

Stack Trace:

[MappingException: duplicate cache region]
NHibernate.Cfg.Binder.BindCollectionSecondPass(XmlNode node, Collection model, IDictionary persistentClasses, Mappings mappings) +1584
NHibernate.Cfg.Binder.BindMapSecondPass(XmlNode node, Map model, IDictionary classes, Mappings mappings) +37
NHibernate.Cfg.MapSecondPass.secondPass(IDictionary persistentClasses) +56
NHibernate.Cfg.SecondPass.DoSecondPass(IDictionary persistentClasses) +66
NHibernate.Cfg.Configuration.SecondPassCompile() +131
NHibernate.Cfg.Configuration.BuildSessionFactory() +12
MyNHibernateContrib.DbMgr.get_Factory() in C:\wc\RDAS\MyNHibernateContrib\DbMgr.cs:33
MyNHibernateContrib.DbMgr.BeginSession() in C:\wc\RDAS\MyNHibernateContrib\DbMgr.cs:67
Global.Application_BeginRequest(Object sender, EventArgs e) in c:\wc\RDAS\Web\App_Code\Global.asax.cs:78
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +65


Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 5:52 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
You might have some duplication in your configuration. What does your config look like?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 22, 2005 5:59 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Are you creating the session factory simultaneously from two threads? You probably should use some synchronization in the code you showed above.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 1:00 pm 
Regular
Regular

Joined: Fri May 13, 2005 4:08 pm
Posts: 64
sergey wrote:
Are you creating the session factory simultaneously from two threads? You probably should use some synchronization in the code you showed above.

I think I was lacking the synchronization code around the creation of the session factory. I added the code, and since then have been unable to reproduce the error.

Thank you! (I should have figured that out myself)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.