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.
|