-->
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.  [ 1 post ] 
Author Message
 Post subject: JSF/Hibernate Design
PostPosted: Sat Jun 08, 2013 12:08 pm 
Newbie

Joined: Wed Mar 19, 2008 11:19 am
Posts: 15
Location: Orlando
I am working with an application which consists mainly of Spring, JSF, and Hibernate. I'm trying to come up with some guidelines and would like to get some feedback. The typical pattern is to list records in a datatable, you click the row, then pick some option (eg. Update/View, etc...). I am calling load() in the setSelectedXXX method of the ManagedBean/View Model, via the DAO which just delegates to Session.load(), but it seems that it causes problems related to page reloads. I had considered calling load() from getSelectedXXX, but am unsure if that approach is considered "good" because it will be called many times when the page is being rendered. I decided to tweak the load() method of my DAO to first check if the object is already associated with a session, and load if not, otherwise, just return the object. So... 1. Should I just make the call to load() in getSelectedXXX instead? 2. Is there any benefit in checking for a session before calling Session.load()?


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

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.