myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stormspire <stormsp...@gmail.com>
Subject RE: Hibernate Object and JSF Bean Design
Date Fri, 19 Jan 2007 08:31:00 GMT

Hi,
  Right now we are using HibernateInView filter, normally won't have problem
for transactions.  However if we got some exception, the session may be lost
(haven't gone to the detail, dunno why).
  If my managed bean consists two actions, one action retrieves object,
another action update the object.  So if don't use independant view object
to store the value, the hibernate entity will still be available during
these requests, will it still held database connection for it?  If so, I
think it is not scalable.  How JBoss Seam solve it?

Regards
Bruce



Giampaolo Tomassoni-2 wrote:
> 
> From: stormspire [mailto:stormspire@gmail.com]
>> 
>> Now my JSF managed Bean contains some business object which is hiberante
>> object.  
>> My friend told me this design is wrong, he says the managed bean should
>> contain only View Object, and contents of view object is translated from
>> business object.
>> 
>> Am I really Wrong?
>> 
>> As I use lots of lazy loading from hibernate, so I can directly 
>> call object
>> lazily loaded for master and detail example.  Any comments?
> 
> JSF beans may need to be persisted into the session object, so you may get
> problems with transaction boundaries unless you're very careful in
> handling the (de)serialization process and the Hibernate's session and
> connection.
> 
> An out-of-the-shelf approach with similar results but more powerful and
> reliable for you would probably be JBoss Seam, which basicly allows direct
> visibility of business entities from JSF, while correctly handling a lot
> of the hinders which may arise with this.
> 
> You may find it here: http://labs.jboss.com/portal/jbossseam . They say
> it's production. I would say it is an advanced beta. Anyway, what is the
> difference today?
> 
> Cheers,
> 
> Giampaolo
> 
> 
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Hibernate-Object-and-JSF-Bean-Design-tf30326
> 08.html#a8425940
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Hibernate-Object-and-JSF-Bean-Design-tf3032608.html#a8445701
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message