These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NHibernate Architecture used in WinForm application.
PostPosted: Thu Jun 14, 2007 2:57 pm 
Newbie

Joined: Mon Jan 23, 2006 11:44 pm
Posts: 15
Location: New Jersey, US
Hi,

I am not sure if this has been discussed but I didn't find by searching the forum. I know this has been discussed extensively about WebApps. If it is please point me to the discuss.

I've been using NHibernate in my ASP.NET projects with great success and I always use the Sessoin Per Request pattern. Such architecture in web apps works wonderfully.

I just get a WinForm project and it should be simplier as I thought given it's a single user environment. However, a closer look shows there are many different issues to be worried about:

1. How any sessions should I have?
2. How long a session should be kept alive?
3. When should I clear/flush a session?
4. How transaction should be controled?

Therefore, is there any architecture best practice round?

Thanks,

Hongze


Top
 Profile  
 
 Post subject: Re: NHibernate Architecture used in WinForm application.
PostPosted: Thu Jun 14, 2007 6:30 pm 
Regular
Regular

Joined: Fri Jan 27, 2006 2:32 pm
Posts: 102
Location: California, USA
hzwang wrote:
I am not sure if this has been discussed but I didn't find by searching the forum. I know this has been discussed extensively about WebApps. If it is please point me to the discuss.


There has been a discussion on the forms. I think it's called "Best Practicies for WinForms"


hzwang wrote:
I just get a WinForm project and it should be simplier as I thought given it's a single user environment. However, a closer look shows there are many different issues to be worried about:

1. How any sessions should I have?


I guess it depends on the type of application. In my MDI application, each child form has its own session.

hzwang wrote:
2. How long a session should be kept alive?


The session stays alive as long as the form is loaded.

hzwang wrote:
3. When should I clear/flush a session?


The session is flushed when the user saves the form.

hzwang wrote:
4. How transaction should be controled?


I only use a transaction around the save operation. So if any errors occur during save, they are all rolled back.

hzwang wrote:
Therefore, is there any architecture best practice round?


Not sure if any of this is "best practice" but it seems to be working for me.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.