NHibernate Facility 2.0 RC is out

111 views
Skip to first unread message

Henry Conceição

unread,
Mar 14, 2011, 9:26:26 PM3/14/11
to castle-pro...@googlegroups.com, Castle Project Users
Hi all,

I would like to announce that NHibernate Facility 2.0 RC is out. Here
is the change list since from beta 3:

- Updated to NHibernate 3.1.0 GA
- Updated to Core 2.5.2 and Windsor 2.5.3
- Updated to Services Tx 2.5.0 and Auto Tx 2.5.1

- NHibernate Facility Event Listeners Configuration (Facilities-99)
- XmlConfigurationBuilder for NHibernate's own configuration file
(Facilities-106)
- Lazy Session Factory Inititialization (Facilities-112)
- Facility needs a way to modify Configuration instance (Facilities-113)
- Persistent Configuration Builder (Facilities-116)
- IConfigurationBuilder for Individual factories. (Facilities-119)
- Support Stateless Session in NHibernate Facility (Facilities-142)
- Derive the filename from session factory ID or alias when not
explicitly specified. (Facilities-117)
- Derive dependant files from the <assemblies></assemblies> node
entries (common usage) when not explicitly specified.(Facilities-117)
- Fluent Configuration initial support

- Fixed: DefaultSessionManager should remove session from session
store if transaction enlistment fails (Facilities-103)
- Fixed: Transaction RespourceAdapter needs to implement IDisposable
(Facilities-129)


Download link: http://sourceforge.net/projects/castleproject/files/NHibernate%20Facility/2.0/Castle.Facilities.NHibernateIntegration-2.0.RC.zip/download


Cheers,
Henry Conceição

dagda1

unread,
Mar 15, 2011, 4:43:27 AM3/15/11
to Castle Project Development List
Are there any thoughts about how to get the latest castle releases
into packages for openwarp or nuget?
> Download link:http://sourceforge.net/projects/castleproject/files/NHibernate%20Faci...
>
> Cheers,
> Henry Conceição

Krzysztof Koźmic

unread,
Mar 15, 2011, 5:28:22 AM3/15/11
to castle-pro...@googlegroups.com
+1.

I would love if we could automate our release process in general to
include automated tagging in Git, pushing to download location and
publishing nuget packages.

Right now it's just too much manual work guys.

Krzysztof

John Simons

unread,
Mar 16, 2011, 3:43:58 PM3/16/11
to Castle Project Development List
Even this one is out :)
Henry is on fire!

Wouldn't it be good if Craig releases the WCF Facility too, wink
wink!!!

Henry, thanks + congrats on all these releases.

Cheers
John

On Mar 15, 12:26 pm, Henry Conceição <henry.concei...@gmail.com>
wrote:
> Hi all,
>
> I would like to announce that NHibernate Facility 2.0 RC is out. Here
> is the change list since from beta 3:
>
> - Updated to NHibernate 3.1.0 G
> - Updated to Core 2.5.2 and Windsor 2.5.3
> - Updated to Services Tx 2.5.0 and Auto Tx 2.5.1
>
> - NHibernate Facility Event Listeners Configuration (Facilities-99)
> - XmlConfigurationBuilder for NHibernate's own configuration file
> (Facilities-106)
> - Lazy Session Factory Inititialization (Facilities-112)
> - Facility needs a way to modify Configuration instance (Facilities-113)
> - Persistent Configuration Builder (Facilities-116)
> - IConfigurationBuilder for Individual factories. (Facilities-119)
> - Support Stateless Session in NHibernate Facility (Facilities-142)
> - Derive the filename from session factory ID or alias when not
> explicitly specified. (Facilities-117)
> - Derive dependant files from the <assemblies></assemblies> node
> entries (common usage) when not explicitly specified.(Facilities-117)
> - Fluent Configuration initial support
>
> - Fixed: DefaultSessionManager should remove session from session
> store if transaction enlistment fails (Facilities-103)
> - Fixed: Transaction RespourceAdapter needs to implement IDisposable
> (Facilities-129)
>
> Download link:http://sourceforge.net/projects/castleproject/files/NHibernate%20Faci...
>
> Cheers,
> Henry Conceição

Kenneth Siewers Møller

unread,
Apr 5, 2011, 5:20:06 PM4/5/11
to castle-pro...@googlegroups.com
Hi,

The NHibernateFacility version 2.0 RC breaks the Query<> API of NHibernate. I can do QueryOver<> but Query<> throws a NullReferenceException.

I believe it should be easy to fix as it's an internal change in NHibernate between version 3.0.0.4000 and 3.1.0.4000 (I've read somewhere).
Unfortunately I don't think I'm able to fix it, but does someone know of a workaround to get the Query<> API working?


Thanks,
Kenneth

>
> Cheers,
> Henry Conceição

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en.




--
Med venlig hilsen / Kind regards
Kenneth Siewers Møller

Maximilian Raditya

unread,
Apr 6, 2011, 1:09:57 AM4/6/11
to castle-pro...@googlegroups.com
2011/4/6 Kenneth Siewers Møller <ken...@siewers.dk>

The NHibernateFacility version 2.0 RC breaks the Query<> API of NHibernate. I can do QueryOver<> but Query<> throws a NullReferenceException.


It seems it's a bug in NHibernate LinqExtensionMethods implementation. If you take a look at LinqExtensionMethods.Query<T>(this ISession) implementation in NHibernate souce code, it's currently implemented like this:
        public static IQueryable<T> Query<T>(this ISession session)
        {
            return new NhQueryable<T>(session as ISessionImplementor);
        }
 
when it should be implemented like this:
        public static IQueryable<T> Query<T>(this ISession session)
        {
            return new NhQueryable<T>(session.GetSessionImplementation());
        }
 
The explanation is that in NHibernate SessionImpl, it inherits from ISessionImplementor, while in NHibernateFacility SessionDelegate, it doesn't inherit from ISessionImplementor. That's why when SessionDelegate cast back to ISessionImplementor, it became null.
 
I think this bug should be reported in here: http://jira.nhforge.org.
 
 
 

--
Regards,

Maximilian Haru Raditya

Kenneth Siewers Møller

unread,
Apr 6, 2011, 2:33:16 AM4/6/11
to castle-pro...@googlegroups.com
Okay, I see. The problem is just that the bug isn't reproducible with NHibernate alone. How can I report a bug, that is not in NHibernate itself.
What I don't understand is, why the NHibernate Facility is breaking the correct behavior of NHibernate? Shouldn't it be working transparently?

Kenneth

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en.

TigerShark

unread,
Apr 6, 2011, 2:55:28 AM4/6/11
to Castle Project Development List
Sorry, yes, I do understand why the behavior is broken by NHibernate
Facility and I've reported it as a bug http://216.121.112.228/browse/NH-2626


Kenneth

On Apr 6, 8:33 am, Kenneth Siewers Møller <kenn...@siewers.dk> wrote:
> Okay, I see. The problem is just that the bug isn't reproducible with
> NHibernate alone. How can I report a bug, that is not in NHibernate itself.
> What I don't understand is, why the NHibernate Facility is breaking the
> correct behavior of NHibernate? Shouldn't it be working transparently?
>
> Kenneth
>
>
>
>
>
>
>
>
>
> On Wed, Apr 6, 2011 at 07:09, Maximilian Raditya <m4h...@gmail.com> wrote:
> > 2011/4/6 Kenneth Siewers Møller <kenn...@siewers.dk>
>
> >> The NHibernateFacility version 2.0 RC breaks the Query<> API of
> >> NHibernate. I can do QueryOver<> but Query<> throws a
> >> NullReferenceException.
>
> > It seems it's a bug in NHibernate LinqExtensionMethods implementation. If
> > you take a look at LinqExtensionMethods.Query<T>(this ISession)
> > implementation in NHibernate souce code, it's currently implemented like
> > this:
>
> >         public static IQueryable<T> Query<T>(this ISession session)
> >         {
> >             return new NhQueryable<T>(session as ISessionImplementor);
> >         }
>
> > when it should be implemented like this:
>
> >         public static IQueryable<T> Query<T>(this ISession session)
> >         {
> >             return new NhQueryable<T>(*session.GetSessionImplementation()*);

Henry Conceição

unread,
Apr 6, 2011, 3:00:11 AM4/6/11
to castle-pro...@googlegroups.com
It looks like a bug in the nhfacility. Can you please open a ticket
for it? I'll take o look later this week. Btw, a test case reproducing
the issue would be pretty handy.

Cheers,
Henry Conceição

Kenneth Siewers Møller

unread,
Apr 6, 2011, 4:14:04 AM4/6/11
to castle-pro...@googlegroups.com
I just did a quick extension method that works around the Query<T> API. I did the same implementation, but instead of calling "session as ISessionImplementor" I did "session.GetSessionImplementation()" and it works...
This is a bug in NHibernate. Even the docs says that the method GetSessionImplementation() is for use with wrappers, so I can't really argue that this should be a bug in the facility.


Kenneth

2011/4/6 Henry Conceição <henry.c...@gmail.com>

Kenneth Siewers Møller

unread,
Apr 6, 2011, 4:47:32 AM4/6/11
to castle-pro...@googlegroups.com

Maximilian Raditya

unread,
Apr 6, 2011, 8:22:22 AM4/6/11
to castle-pro...@googlegroups.com
2011/4/6 Kenneth Siewers Møller <ken...@siewers.dk>
Okay, I see. The problem is just that the bug isn't reproducible with NHibernate alone. How can I report a bug, that is not in NHibernate itself.
What I don't understand is, why the NHibernate Facility is breaking the correct behavior of NHibernate? Shouldn't it be working transparently?

 
It's similar the bug I've reported in here: http://216.121.112.228/browse/NH-2457. It used to be a bug in 3.0.0, but it's been fixed in 3.1.0.
 
As I've explained in here: http://groups.google.com/group/castle-project-users/browse_thread/thread/5efc9f3b7b5d6a08, SessionDelegate doesn't implement ISessionImplementor because it's internal to NHibernate code base, thus it only implements ISession.
 
When you open a new ISession using NHibernate Facility ISessionManager.OpenSession(), it actually returns SessionDelegate instead of SessionImpl. SessionDelegate is wrapper for SessionImpl in NHibernate Facility. Since SessionDelegate doesn't implement ISessionImplementor, it would return null in the following code:
        public static IQueryable<T> Query<T>(this ISession session)
        {
            return new NhQueryable<T>(session as ISessionImplementor);
        }
 
That's why you got a NullReferenceException, but not with this code:
        public static IQueryable<T> Query<T>(this ISession session)
        {
            return new NhQueryable<T>(session.GetSessionImplementation());
        }
 
It would work otherwise if SessionDelegate implemented ISessionImplementor. But that would be another question :).

Maximilian Raditya

unread,
Apr 6, 2011, 8:35:37 AM4/6/11
to castle-pro...@googlegroups.com
On Wed, Apr 6, 2011 at 1:55 PM, TigerShark <kenneth...@gmail.com> wrote:
Sorry, yes, I do understand why the behavior is broken by NHibernate
Facility and I've reported it as a bug http://216.121.112.228/browse/NH-262

 
Could you add in the bug report that it would also break with IStatelessSession, in addition to ISession, since both methods in LinqExtensionMethods.Query<T>() have the same buggy implementations? See here: 
        public static IQueryable<T> Query<T>(this ISession session)
        {
            return new NhQueryable<T>(session as ISessionImplementor);
        }
 
	public static IQueryable<T> Query<T>(this IStatelessSession session)
	{
		
return new NhQueryable<T>(session as ISessionImplementor);
	}
 
 
So both implementations need to be changed. 

Henrik

unread,
Apr 6, 2011, 10:19:29 AM4/6/11
to Castle Project Development List
Hi,

There are also a few bugfixes and perf improvements on my github for
the transactions project and the facility.

Currently on the develop branch of .Transactions, which is now the
same source tree as AutoTx, is a fix for a null ref exception when
registering the transaction manager manually in the kernel (not
through facility that is), on dispose.

The current master is the same externally (v2.5.1), develop branch
contains these fixes. This changes how you register the transaction
facility.
This includes the read only transactions.

I'm going to start following this branching method:
http://nvie.com/posts/a-successful-git-branching-model/

I'll keep you posted on changes I make to them. The 2.5.1 version can
be considered done though.

Cheers
Henrik

On Apr 6, 2:35 pm, Maximilian Raditya <m4h...@gmail.com> wrote:

Kenneth Siewers Møller

unread,
Apr 6, 2011, 10:21:59 AM4/6/11
to castle-pro...@googlegroups.com
I've commented on the issue. Hopefully Fabio has the time to take a look at it. It really is a simple patch... :)

Kenneth

--
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en.

Kenneth Siewers Møller

unread,
Apr 6, 2011, 11:17:14 AM4/6/11
to castle-pro...@googlegroups.com
It's fixed in NH 3.2 http://216.121.112.228/browse/NH-2626

Kenneth

2011/4/6 Kenneth Siewers Møller <ken...@siewers.dk>
I've commented on the issue. Hopefully Fabio has the time to take a look at it. It really is a simple patch... :)

Maximilian Raditya

unread,
Apr 6, 2011, 11:40:52 AM4/6/11
to castle-pro...@googlegroups.com
2011/4/6 Kenneth Siewers Møller <ken...@siewers.dk>


Wow, it's so quick. Impressive! Thanks to Patrick.
 
Well, I think since this has been fixed in the trunk, let's just wait until NH 3.2.0 G.A. released then.

Maximilian Raditya

unread,
Apr 6, 2011, 11:49:13 AM4/6/11
to castle-pro...@googlegroups.com
2011/4/6 Henry Conceição <henry.c...@gmail.com>

It looks like a bug in the nhfacility. Can you please open a ticket
for it? I'll take o look later this week. Btw, a test case reproducing
the issue would be pretty handy.


No, Henry. It's an NH bug -- unless SessionDelegate is required to implement ISessionImplementor of course. Fortunately, it's *just* been fixed in the trunk, to be included in NH 3.2.0.

Henry Conceição

unread,
Apr 6, 2011, 8:09:09 PM4/6/11
to castle-pro...@googlegroups.com, Maximilian Raditya
Ow, got it.

I thought that the Query<T>(this ISession session) belongs the
ISession and bugged cast was in the SessionDelegate.

Cheers,
Henry Conceição

Henrik

unread,
Apr 14, 2011, 9:57:46 AM4/14/11
to Castle Project Development List
Hi,

Have a look at the new NHFacility I implemented on my development tree
and see what you think!

If you have time, there's a single failing test... Everything is in
the same project right now for Tx and AutoTx, but NHib is in its own.

Cheers,
Henrik
> Download link:http://sourceforge.net/projects/castleproject/files/NHibernate%20Faci...
>
> Cheers,
> Henry Conceição
Reply all
Reply to author
Forward
0 new messages