-->
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.  [ 5 posts ] 
Author Message
 Post subject: Purpose of new Stateless Session
PostPosted: Tue Aug 02, 2005 6:36 pm 
Newbie

Joined: Sun Jul 31, 2005 7:53 pm
Posts: 17
Dear All,

What is the purpose of the new StatelessSession available in Hibernate 3.1 beta 1? Is there going to be an equivalent 'openStatelessSession' in EJB3's EntityManager?

Let us say I am developing a Web application using JSF and EJB3. Typically I would not want any of the objects returned by the EJB3 layer to be associated with a persistence context, as otherwise when I pass them to my JSF layer (which I assume is valid as EJBs are now POJO value objects) and JSF updates them, EJB3 will attempt to serialize them - even though the user may not have clicked 'Save' in the UI (eg. there may be some validation errors, or the user may be in the middle of a 'wizard'-style interaction)

Is this the intent of StatelessSession? To make it easy to use Hibernate's mapping functionality without also having to worry about its lifecycle management capabilities, in situations where the lifecycle is, effectively, being managed by someone else (in this case, JSF).

emmanuel has commented that StatelessSession has been done for non OLTP processing, but this doesn't really answer my question (not least because I don't know what OLTP stands for!): is it going to be there in EJB3? Is it applicable to the scenario I explained above?

Or have I gotten the wrong end of this completely?

Many thanks in advance,

Richard.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 7:32 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Your assumptions are wrong,
When you will wrok with your objects at the JSF level, they 'll be detached, because your epsistence context will most likely be closed.

Like I said StatelessSession are here for non-OnLineTransactionProcess (aka Batch processing) where memory consumption and speed is critical. StatelessSession has some drawbacks, so don't use it unless your need it.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 7:33 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
And it will not be part of the EJB3, since it's a corner case.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 04, 2005 7:33 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
And cross posting is bad, I have to work twice as much ;-)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 05, 2005 12:31 am 
Beginner
Beginner

Joined: Mon Dec 15, 2003 5:25 am
Posts: 48
Location: Delhi, India
As hibernate is not going to update objects until you tell Hibeernate to do so.

I have used annotated POJOs with JSF in same way you described and it wroked like breeze.

_________________
Vinod K. Singh


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.