I actually took a different route, and ripped out the code from Castle
ActiveRecord  having to deal with SesisonScope and TransactionScope.
Then at the app startup I scan my assemblies for ClassMap from FNH and
register them with SessionHolder. Then in my Dao-s i ask SessionHolder
to get me the session for the type I am working with. I found this
very easy to work with. I can have as many separate session/
transaction scopes as I want, or I can have just one. This also allows
me to open session only at the very last moment I actually need it.


On Jan 8, 1:12 pm, José F. Romaniello <[email protected]> wrote:
> ITransaction != IDbTransaction
>
> 2010/1/8 reggieboy <[email protected]>
>
>
>
> > If Nhibernate does not open a connection when opening a session?
>
> > Then when will Nhibernate open and close a connection?
>
> > Is it when you start a transaction?
>
> > session.BeginTransaction()?
>
> > On Jan 7, 7:57 am, José F. Romaniello <[email protected]> wrote:
> > > Am I wrong if I say that this code should NOT open a connection?
>
> > >  NHibernate.ISession ormSession = GetSessionFactory().OpenSession();
>
> > >  NHibernate.Context.CurrentSessionContext.Bind(ormSession);
-- 
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