-->
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: Design: session lifecycle in a GUI application
PostPosted: Sat Sep 03, 2005 3:50 pm 
Newbie

Joined: Mon Sep 08, 2003 10:06 am
Posts: 14
How do GUI applications typically manage the session lifecycle? I'm used to using Hibernate in Web applications where the session lifecycle is pretty clear.

The GUI application I'm working on opens a session for the first database transaction from a thread and then just holds it open until the application is closed. This model fails when multiple instances of the application access the same database due to concurrency problems and due to stale versions of versioned persisted objects.

The application uses lazy instantiation heavily, so I can't just open sessions for each database transaction and then close them immediately. What's the next best option? Is there a standard practice for this sort of application?

(I couldn't find much guidance in Hibernate in Action.)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 03, 2005 4:08 pm 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
Work out what objects need to be displayed, load and hyrdate the colletions, detatch the objects and send to the view layer.

I ended up using data transfer objects which were created by the data/model layer to transfer the data. The handy thing is that I can easilly change the UI.


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.