PDA

View Full Version : the Nhibernate-State of the art: bidirectional m-n associations /open-session-in-view



boriska
02-12-2007, 04:14 PM
Kudos to you! We all here are interested in your work!

Short about my doubts:
I have to migrate one solution from WinForm to ASP.NET. So I’m concerning different alternatives and Nhibernate in persistence layer seems me to be a good choice.

What I didn’t recognize now is the state of the art of Nhibernate. It would be great to have all functionality encapsulated in such IoC-container as Spring.NET.

I wonder e.g. how I can handle bidirectional m:n associations easier. Using NHibernate.generics had as a nice side effect a comfortable handling of 1:n associations. However I didn’t see any working samples of m:n –relationship-implementations. See also http://www.ayende.com/Blog/archive/7179.aspx
It is planned to support this functionality in spring.data.hibernate module with Nhibernate 1.2?

Also I can’t get if open-session-in-view approach is already properly implemented. Why is the Spring.Northwind.Web sample not included in nightly build?

I am very interested in your opinion which I will appreciate.

Thanks,
Boris

Mark Pollack
02-13-2007, 11:33 PM
Hi,

There are no plans at the moment to handle relationships ala NHibernate.Generics. If we do it would likely be more of an integration than a re-implementation. The open-session-in-view is working so you shouldn't expect any issues there. Docs will be forthcoming. I've added Spring.Northwind.Web to CVS so it should be in the nightly build now, but it needs work, to say the least. Something along the lines of the popular article on codeproject "asp.net/nhibernate best practices" is what to expect. Let us know if you have any other questions.

Cheers,
Mark

boriska
02-14-2007, 12:58 PM
Hello Mark,

Having a working sample for nothwind would be nice:)

I am considering use the WCSF (http://www.codeplex.com/websf) in front-end and Spring.NET + Nhibernate in persistence layer (+logging) so I’m trying to play with this approach. May be it would “cleaner” to use OjectBuilder instead (http://www.codeplex.com/nhbbusiness) … Anyway
Firstly I tried without OSIV and it works. Now I got last nightly builds for Spring and Spring.Data.Hibernate12.
Error that I got on SaveAndUpdate said:
"Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
but I didn't change any tnx Settings


Thanks,
Boris

Mark Pollack
02-15-2007, 02:52 PM
Hi,

I haven't reviewed either of the two projects your refer to in any depth so I can't give you an opinion. You feedback on your experience would be much appreciated.

Just to put in the main thread your last edit comment

"marking methods with [Transaction()] and/or configuring Transactional Proxy solved my issue "

So that people see there isn't a lingering issue.

Cheers,
Mark