NHibernate 3.2.0 Beta2 released

213 views
Skip to first unread message

Fabio Maulo

unread,
Jun 20, 2011, 8:08:44 AM6/20/11
to nhu...@googlegroups.com
NHibernate 3.2.0 Beta2 was released today.
There are very good news... just to mention one: unidirectional one-to-many with not-nullable FK is inserted with one round-trip (just INSERT instead INSERT+UPDATE).

Many of others stuff are available in releasenotes.txt (no all, just many).

Bye.

Ricardo Peres

unread,
Jun 20, 2011, 9:10:16 AM6/20/11
to nhusers
Congratulations to the NH team, lots of bugs fixed, lots of new
functionalities!
Fabio: could you please explain what exactly is unidirectional one-to-
many? I saw your post on NHibernate Development some time ago, but
still don't know what it is about.

Thanks,

RP

Kenneth

unread,
Jun 20, 2011, 9:20:06 AM6/20/11
to nhusers

Fabio Maulo

unread,
Jun 20, 2011, 9:22:23 AM6/20/11
to nhu...@googlegroups.com
so, don't worry.
If you don't know what is it is just because you don't have needed it; if you will need it you will not see the problem because it was fixed.

Fabio Maulo

unread,
Jun 20, 2011, 9:29:31 AM6/20/11
to nhu...@googlegroups.com
Yes but now we have to rewrite that part of documentation.
Would you provide a patch ?

... well... with the release of NH3.2.0 there will be some books, about NH, to re-write ;)

Ricardo Peres

unread,
Jun 20, 2011, 9:52:32 AM6/20/11
to nhusers
Yes, it is just my curiosity!
Kenneth, sorry, but I don't find anything related in the NH
documentation, but I found it on the Hibernate documentation.

RP

José F. Romaniello

unread,
Jun 20, 2011, 10:30:07 AM6/20/11
to nhu...@googlegroups.com
Very nice Fabio! thank you very much to you and others from the nhibernate team for the good work.
The unidirectional one-to-many thing, I love it. I wrote a lot of bidirectional relationship just to avoid the extra update in the past :)


2011/6/20 Fabio Maulo <fabio...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/GunIBqHCCN8J.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.

Angel Java Lopez

unread,
Jun 20, 2011, 10:39:48 AM6/20/11
to nhu...@googlegroups.com
Great!

Thanks, Fabio, for resolving the issue we discussed some weeks ago.

Ricardo: an example of the problem now resolved:
http://ajlopez.wordpress.com/2011/05/19/nhibernate-3-part-6-one-to-many-with-many-to-one/
(I had never noticed the problem until adding logging; Jason Dentler book mentioned that the BookId and ChapterIndex should be nullable, but as far I remember, he didn't explain why; NHibernate doc also mentioned the nullable requirement, but for me, it was no clear reason for that requirement)

Previous workaround:
http://ajlopez.wordpress.com/2011/05/28/nhibernate-3-part-7-one-to-many-with-inverse/

Fabio: I'm curious, why the previous behavior was "two pass"?

Angel "Java" Lopez
http://www.ajlopez.com
http://twitter.com/ajlopez

--

Ricardo Peres

unread,
Jun 20, 2011, 12:16:05 PM6/20/11
to nhusers
Thanks, Angel! You are... er... an angel! ;-)


On Jun 20, 3:39 pm, Angel Java Lopez <ajlopez2...@gmail.com> wrote:
> Great!
>
> Thanks, Fabio, for resolving the issue we discussed some weeks ago.
>
> Ricardo: an example of the problem now resolved:http://ajlopez.wordpress.com/2011/05/19/nhibernate-3-part-6-one-to-ma...
> (I had never noticed the problem until adding logging; Jason Dentler book
> mentioned that the BookId and ChapterIndex should be nullable, but as far I
> remember, he didn't explain why; NHibernate doc also mentioned the nullable
> requirement, but for me, it was no clear reason for that requirement)
>
> Previous workaround:http://ajlopez.wordpress.com/2011/05/28/nhibernate-3-part-7-one-to-ma...
>
> Fabio: I'm curious, why the previous behavior was "two pass"?
>
> Angel "Java" Lopezhttp://www.ajlopez.comhttp://twitter.com/ajlopez

Fabio Maulo

unread,
Jun 20, 2011, 2:19:46 PM6/20/11
to nhu...@googlegroups.com
Too much words...
Some days I'll flood you with my questions ;)

Richard Wilde

unread,
Jun 21, 2011, 3:56:33 AM6/21/11
to nhu...@googlegroups.com

Excellent news, will have to update my presentation now as this was always a sticky point when discussing!

Keep up the good work and a big thank you to all the team for an superb product...

Thanks Guys, Rippo

--

Kenneth

unread,
Jun 21, 2011, 4:32:38 AM6/21/11
to nhusers
I've just runned the NH-941 test, and it inserts both objects and the
child object has the foreignkey in the insert statement, however the
"normal" update is STILL executed. So 3 statements are executed. Why?

Kenneth

Fabio Maulo

unread,
Jun 21, 2011, 8:49:29 AM6/21/11
to nhu...@googlegroups.com
No Martini, no party!

Kenneth

unread,
Jun 22, 2011, 2:32:43 AM6/22/11
to nhusers
I prefer beers. So I guess it's by design?

Shatl

unread,
Jun 22, 2011, 4:48:18 AM6/22/11
to nhu...@googlegroups.com
Hi,
thanks for a great job.

But unfortunately I'm still getting exception when trying to use lazy properties.

See details in attachments
entity.cs
exception.txt
mapping.hbm.xml

Ricardo Peres

unread,
Jun 22, 2011, 6:41:50 AM6/22/11
to nhusers
Does your Entity base class have a private setter for a property,
possibly the id?
If it does, change it to protected.

RP
>  entity.cs
> < 1KViewDownload
>
>  exception.txt
> 33KViewDownload
>
>  mapping.hbm.xml
> 1KViewDownload

Vitaliy Kryvosheiev

unread,
Jun 22, 2011, 10:57:02 AM6/22/11
to nhu...@googlegroups.com
No, it does not have properties with private setters, but have some private fields.

Regards,
  Vitaliy


--
You received this message because you are subscribed to the Google Groups "nhusers" group.

Fabio Maulo

unread,
Jun 22, 2011, 11:24:15 AM6/22/11
to nhu...@googlegroups.com
System.NotSupportedException: Specified method is not supported. 
Are you sure you are using NH3.2.0 ?

Shatl

unread,
Jun 23, 2011, 2:31:12 AM6/23/11
to nhu...@googlegroups.com
Yes, exception is wrapped into NHibernate.Exceptions.GenericADOException, NHibernate, Version=3.2.0.2002, Culture=neutral, PublicKeyToken=aa95f207798dfdb4

But it has inner exception that is comes from NHibernate.Proxy.AbstractProxyFactory.GetFieldInterceptionProxy
 at NHibernate.Proxy.AbstractProxyFactory.GetFieldInterceptionProxy(Object instanceToWrap)
          at NHibernate.Tuple.PocoInstantiator.Instantiate()
          at NHibernate.Tuple.PocoInstantiator.Instantiate(Object id)
          at NHibernate.Tuple.Entity.AbstractEntityTuplizer.Instantiate(Object id)
          at NHibernate.Persister.Entity.AbstractEntityPersister.Instantiate(Object id, EntityMode entityMode)
          at NHibernate.Impl.SessionImpl.Instantiate(IEntityPersister persister, Object id)
 
Why it uses AbstractProxyFactory here?

I moved from Castle Proxy to default NH3.2 proxy generator.
Also, I'm using SharpArchitecture library, could this cause configuration issue?

Shatl

unread,
Jun 23, 2011, 9:09:55 AM6/23/11
to nhu...@googlegroups.com
Finally I managed this to work.
Here are several things about this issue:
1) I was using Bytecode Castle proxy generator, switching  to NH3.2 build-in generator fixed the issue;

After this another problem appeared - if entity has lazy properties and references another entities (one-to-one in my case), referenced entities were not loaded (was null).
 
It was because I used nosetter or field accessors.
Removing access declaration from mapping fixed this issue.

Again, NH team, thanks for a great work done. :)
Reply all
Reply to author
Forward
0 new messages