• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Question on conversational state of statefull session bean

 
Ranch Hand
Posts: 211
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friendly Ranchers,

I came across this in specs and i am unable to understand it.


A container must not passivate a stateful session bean with an extended persistence context unless the following conditions are met:[10]
•All the entities in the persistence context are serializable.
•The EntityManager is serializable


I am unable to understand what extended persistence context mean ? , i went through many existing threads but their discussion was a little unclear to me.What i understood through thier discussion
was that extended persistence means that the transaction is not boxed to a single method invocation , even if i have got it right i ll like to know more this from your inputs.


Regards,
Shroff.
 
Creator of Enthuware JWS+ V6
Posts: 3412
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sagar,

The Persisteny context is part of JPA (JSR-220, Java Persistence API) and not part of this exam (it is not explained in the JSR-220, EJB core specifications). The explanation is found in the JPA specs, and let me just copy a bit about extended persistence context from there:

3.3 Persistence Context Lifetime
When an extended persistence context is used, the extended persistence context exists from the time the EntityManager instance is created until it is closed. This persistence context might span multiple transactions and non-transactional invocations of the EntityManager. The extended persistence context is enlisted in the current transaction when the EntityManager is invoked in the scope of that transaction or when the stateful session bean to which the extended persistence context is bound is invoked in the scope of that transaction.
An EntityManager with an extended persistence context maintains its references to the entity objects after a transaction has committed. Those objects remain managed by the EntityManager, and they may be updated as managed objects between transactions. Navigation from a managed object in an extended persistence context results in one or more other managed objects regardless of whether a transaction is active. When an EntityManager with an extended persistence context is used, the persist, remove, merge, and refresh operations may be called regardless of whether a transaction is active. The effects of these operations will be committed to the database when the extended persistence context is enlisted in a transaction and the transaction commits.


More about the topic can be found in the JPA specs.

Regards,
Frits
 
Sagar Shroff
Ranch Hand
Posts: 211
Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Frits , thanks for informing me about that , can you please explain me what this line in the above snippet means
,

Navigation from a managed object in an extended persistence context results in one or more other managed objects regardless of whether a transaction is active


I dint really understood what navigation means in the current context ?
 
Put a gun against his head, pulled my trigger, now he's dead, that tiny ad sure bled
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic