Re: NHibernate initialization - how exactly does it happen?

39 views
Skip to first unread message

Billy McCafferty

unread,
Jun 27, 2013, 6:01:32 PM6/27/13
to sharp...@googlegroups.com
Hi Rasmus,

            var configuration = cache.LoadConfiguration(CONFIG_CACHE_KEY, null, mappingAssemblies);

The line above will return null the first time through.  If the configuration hasn't been configured and cached yet, null will be returned and a new Configuration will be created.

Please let me know if that doesn't clear it up.

Billy McCafferty



On Sun, Jun 23, 2013 at 12:37 PM, Rasmus <rasm...@gmail.com> wrote:
I am a little confused.  I see the NHibernateInitializer.Initialize class.  however, I see the snippet of code below:

var mappingAssemblies = new[] {
                typeof(MyDomainClass).Assembly.GetName().Name
            };

            var configuration = cache.LoadConfiguration(CONFIG_CACHE_KEY, null, mappingAssemblies);

With this snippet above, the section below will never run as configuration is never null (per my understanding):

f (configuration == null) {
                configuration = new Configuration();

                .....................
}

This section will not execute.

So, how exactly do the mapping conventions, db driver etc get initialized?

--
You received this message because you are subscribed to the Google Groups "S#arp Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharp-lite+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rasmus

unread,
Jun 27, 2013, 8:09:51 PM6/27/13
to sharp...@googlegroups.com
Yes, it does. Thank you.
Reply all
Reply to author
Forward
0 new messages