EmptyInterceptor SetSession / Session Factory Breaking Changes

"Will Shaver" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nhibernate.devel
Message-ID <[email protected]>
It looks like Fabio did a bunch of work last weekend refactoring the session
factory and other session factory related stuff. Based on the amount of code
that was changed, I'm sure it was needed. Merging my project to the trunk, I
did find one breaking change.

The previous versions called something like:

if(isSessionScopedInterceptor)
  interceptor.SetSession(sessionImpl);

on each Interceptor registered with the session. This was useful in that you
could then overload this in the interceptor and then keep a reference to
that session. This is now removed, which is easy enough to deal with -
simply call the method manually after creating the session.

session = sessionFactory.OpenSession(interceptor);
interceptor.SetSession(session);

I of course only found out about this breaking change when running my
interceptor unit tests. (How did I ever write software without unit tests?
Who knows?!)

Instead, we should remove the SetSession(ISession session) method from the
Interceptor interface and EmptyInterceptor implementation. This will force
people to realize "ohh, if it isn't there, obviously it isn't being called
by NHCore anymore." Then they will change it to non-virtual and call it
themselves without needing to look into the source as I did...

 - Will

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
Nhibernate-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nhibernate-development
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.