Reasons (which are not very good)
- I want to understand exactly how CpBT works so decided to implement
my own as a learning excercise.
- I don't really want a reference to uNHAddins in my project

Functionally, what it does is exactly what I want.

What do you mean setting at wrong moment?  I'm setting before calling
config.BuildSessionFactory()

My class also has an ISessionFactoryImplementer dependency, but I
tried with a parameter-less constructor as well and got the same
error. (and there is nothing in the log so I would be surprised if
this was the problem?)

Thanks,
chris


On Oct 9, 5:48 pm, Fabio Maulo <[email protected]> wrote:
> You are setting that in the wrong moment or your impl. can't
> be instantiated.btw... which is the reason ? can you explain ?
>
> 2009/10/9 chris <[email protected]>
>
>
>
>
>
>
>
> > I had tried that as well... and just tried again to prove....
>
> > configuration.SetProperty(Environment.CurrentSessionContextClass,
> > typeof(CurrentSessionContext).AssemblyQualifiedName);
>
> > same error....
>
> > On Oct 9, 5:41 pm, Fabio Maulo <[email protected]> wrote:
> > > Yes... AssemblyQualifiedName or, at least, FullName and Assembly name.
>
> > > 2009/10/9 chris <[email protected]>
>
> > > > Hi,
> > > > I'm trying to implement my own CurrentSessionContext based on the uNH
> > > > ThreadLocalConversationalSessionContext.
>
> > > > I've turned on logging, and the log shows the
> > > > current_session_context_class being set.  However, as soon as I try to
> > > > access the GetCurrentSession() method of the factory, I get an
> > > > exception (below) and when I check, the CurrentSessionContext class is
> > > > null.
>
> > > > The only difference in my setup that I can note to the working uNH one
> > > > is the fact that I'm using C# to configure my class.
>
> > > >    configuration.SetProperty(Environment.CurrentSessionContextClass,
> > > > "MyApplication.Common.NHibernate.Conversation.CurrentSessionContext");
>
> > > > Any ideas how I can resolve this?
>
> > > > Many thanks,
> > > > Chris
>
> > > > 2009-10-09 16:59:18,068 [9] DEBUG NHibernate.Impl.SessionFactoryImpl
> > > > [(null)] <(null)> - instantiating session factory with properties:
> > > > {'use_reflection_optimizer'='True',
> > > > 'connection.provider'='NHibernate.Connection.DriverConnectionProvider',
> > > > 'dialect'='NHibernate.Dialect.MsSql2005Dialect',
> > > > 'connection.driver_class'='NHibernate.Driver.SqlClientDriver',
>
> > 'proxyfactory.factory_class'='NHibernate.ByteCode.Castle.ProxyFactoryFactor
> > y,
> > > > NHibernate.ByteCode.Castle', 'show_sql'='False',
> > > > 'connection.connection_string'='xxxxxxx;',
>
> > 'current_session_context_class'='MyApplication.Common.NHibernate.Conversati
> > on.CurrentSessionContext'}
>
> > > > NHibernate.HibernateException: No CurrentSessionContext configured
> > > > (set the property current_session_context_class)!
> > > >   at NHibernate.Impl.SessionFactoryImpl.GetCurrentSession()
>
> > > --
> > > Fabio Maulo
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to