Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Doubt related to SFSB made ready for Serialization

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic