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.  [ 1 post ] 
Author Message
 Post subject: NHibernate unnecessary loads assembly for each type!!!
PostPosted: Tue Mar 11, 2008 3:59 am 
Newbie

Joined: Tue Mar 11, 2008 3:39 am
Posts: 8
Hello,

I have my persistant classes in outer DLL in directory Plugins (not the same directory as the main program). When i call

Code:
Assembly module = Assembly.LoadFile(Environment.CurrentDirectory +  @"\Plugins\module.dll");

configuration = new Configuration();

configuration.AddAssembly(module);

NHibernate throw an exception, that he can't load a mapping class (file not found).

Reason:
Function:

Code:
Configuration.AddAssembly(Assembly assembly)

uses function (connections: AddAssembly > AddValidatedDocument > BindRoot > BindRootClass > BindClass > ClassForFullNameChecked > ClassForName > TypeFromAssembly):

Code:
ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, bool throwOnError)

And this function have line (!!) :

Code:
Assembly assembly = Assembly.Load(name.Assembly)


Why NHibernate loads again the assembly (and loads it from a name, but I gave him a object of type Assembly). Now he searches for the assembly in folder of main program, but my assembly is in folder Plugins.

In my opinion, this is a bug.

KJ


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

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.