• 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

instance variables and passivation..

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did not understand the following passivation rule (page no 71 in specs). Could someone translate the following into simple English ?

An object that is not directly serializable, but becomes serializable by replacing the references to an enterprise bean�s home and component interfaces, the references to the SessionContext object, the references to the java:comp/env JNDI context and its subcontexts, and the references to the UserTransaction interface by serializable objects during the object�s serialization.

This means, for example, that the Bean Provider must close all JDBC� connections in ejbPassivate and assign the instance�s fields storing the connections to null.

The last bulleted item covers cases such as storing Collections of component interfaces in the conversational state.



Thanks in advance.
 
cowbird
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If this is in the context of session bean passivation, what this paragraph is saying is:

The container uses a special set of rules to passivate session beans, it looks like serialization, but is not really the same. It's not as simple as making non-Serializable variables transient. The container must NOT assure that transient fields are braught back with default values.

When ejbPassivate() completes, you (as a Bean Provider) must make sure that all non-transient instance variables are one of the following:
* Serializable
* null
* Remote or Local Component or Home interface
* SessionCOntext object
* the JNDI context or one of its subcontexts
* UserTransaction interface
* resource manager connection factory (like a DataSource)

Hope this helps...
[ June 09, 2004: Message edited by: Jef Cumps ]
 
Kaarthik Sivashanmugam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply, Jef. It did not answer my question though. What I have quoted in my posting is the last point in the passivation rules. This is mentioned in the specs in addition to what you have added in your posting. I wanted to understand what I have quoted from the specs.
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Karthik,
According to the EJB spec page 72,

The last bulleted item covers cases such as storing Collections of component interfaces in the conversational state.



So, in plain english, the last bulleted point can be described as the following

An object that is not directly serializable, for example, a Collection becomes serializable if it contains the references to ..
1. an enterprise bean�s home and component interfaces
2. the SessionContext object,
3. the java:comp/env JNDI context and its subcontexts
4. the UserTransaction interface

Hope this helps.

Regards
Suman
[ June 10, 2004: Message edited by: Suman Sarker ]
 
it's a teeny, tiny, wafer thin ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic