• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Transient Field - page 72 in spec!

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all,
could you please explain the following statement in detail?
here is the statement in the page 72 in spec:


The restriction on the use of transient fields ensure that container can use java serialization during passivation and activation.


Why is so much importance given here to *transient* fields?
Happy New Year 2004 to all of you!
cheers
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All this means is that the Container *may* use Java serialization to passivate the bean, so the spec is warning the developer that if a variables is marked "transient", you cannot expect the value to be maintained. In other words, you can assume that passivation might serialize your bean, and therefore transient variables are lost.
But then of course there is the *other* little note that warns that since it might NOT be serialization, the transient value won't necessarily be reset to its default value... but that's a different issue.
The thing to remember is the list of *states* your variables are allowed to be in by the end of ejbPassivate() (for a stateFUL session bean). You're required to know this for the exam... to know, for example, that the Container MUST successfully passivate a reference to a SessionContext even if the SessionContext implementation class turned out NOT to be serializable... doesn't matter because it is on the Container's MUST BE PASSIVATED SUCCESSFULLY list.
cheers,
Kathy
 
Tulsi Rai
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i still have confusion. there is a list of *STATE* that *non-transient* instance variables must be for successful passivation. my question here is that is that list of *STATE* required BECAUSE the instance variables are *non-transient*?does making these *non-transient* variables *transeint* instead passivate succefully regardless of whatever state transient variables are?
i am still confused
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic