Hello,
As promised in an earlier post, I created a small Winforms application using NHibernate and also remoting.
The application is just a small example to demonstrate a strategy for handling the session management in a winforms application. This application as a whole is certainly not a best practice for building enterprise-grade applications (you will notice there's no validation nor error-handling code) !
Nevertheless, I think the one-session-per-atomic-data-transaction is the best approach in Winforms applications. I hope the sample may convice you. Notice that all classes and collections are lazy-loaded.
The fact that it's a three-tier application using remoting is not relevant to this approach. By this I mean this approach is
not only suitable for three-tier applications, it works just as well for fat clients.
But on the other hand, this approach is the only possible one if you want to build three-tier applications (unless I'm very much mistaken).
Well, you can download it
here. You'll find a readme.doc in the .zip file with some installation instructions.
Enjoy,
X.