I've found the root of the problem. The issue was that I was adding my
mapping files assembly directly to the hibernate.cfg.xml file.
Therefore all the SessionFactory objects that were created would try
to add these files, ending in a 'Duplicate mapping class' exception.
Instead I add the mapping files assembly in the code and only once.
It's running all fine now.

What do you mean by 'That code should be modified' ? Could you explain
a little bit more please.

On 12 août, 22:26, Fabio Maulo <fabioma...@gmail.com> wrote:
> That code should be modified.
>
> 2009/8/12 graphicsxp <graphic...@googlemail.com>
>
>
>
>
>
> > Hi,
>
> > I've defined two hibernate-configuration, one in my web.config and one
> > in hibernate.cfg.xml.
>
> > The one in  hibernate.cfg.xml is used to create a SessionFactory in
> > the ApplicationStartup event. It's the one I use throughout my
> > application and everyting's fine.
>
> > I've started to use the ASP.net membership provider for NHibernate
> > (http://www.manuelabadia.com/blog/CommentView,guid,3B6CCB3F-2F2A-4DCB-
> > A414-605371A00618.aspx) which uses its own SessionFactory and it has
> > to be defined in the web.config file.
>
> > However since I added it to my web.config file, when I create my
> > SessionFactory in ApplicationStartup, it picks up the one in
> > web.config.
>
> > So is there a way to specify which SessionFactory to use when I call
> > cfg.BuildSessionFactory();  ?
>
> > Thanks
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to