• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt related to SFSB made ready for Serialization

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am studying the specification and I am having some doubts hope someone could help me out with these.

1) According to the specification the SFSB and its Interceptor instances should be ready for serialization after the PrePassivate() method callback. How can the bean developer make the SFSB interceptor's instance variables ready for passivation like to make references to non serializable data null? Should the interceptor also have a PrePassivate method or would the interceptor's AroundInvoke method be called before the PrePassivate method? I thought Interceptor classes do not hold a conversational state so why is it required for SFSB's to have specific instances of the Interceptor and the interceptor is serialized together with the SFSB?

2) In the spec it says that the SFSB is ready for passivation even it contains references to the following as the serialization of those should be handled by the session bean container.
•A reference to a container-managed EntityManager object, even if it is not serializable.
•A reference to an EntityManagerFactory object obtained via injection or JNDI lookup, even if it is not serializable.

but it also says that if a bean is using extended persistence context and the container can passivate the bean only if
•All the entities in the persistence context are serializable.
•The EntityManager is serializable.
so its like if only the bean is using extended persistence the EntityManager should be serializable for the container to passivate the bean? and it also says that the container cannot destroy the bean if it doesnt comply to the above mentioned condition so in that case such beans are not destroyed and would exist without being passivated?


Thanks in advance.
 
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic