nerdexam
Oracle

1Z0-895 · Question #21

A stateful session bean contains a number of instance variables. The types of instance variables A and B are serializable. Instance variable B is a complex type which is populated by many business…

The correct answer is C. The value of helper variable C is used to create the value of instance variable B in a @postActivate E. Instance variable A must be defined transient. Instance variable B must be converted to a Serializable type. See the full explanation below for the reasoning.

Question

A stateful session bean contains a number of instance variables. The types of instance variables A and B are serializable. Instance variable B is a complex type which is populated by many business calls, and can, therefore, not be refilled by the client without starting all over. A helper instance variable C is defined as having a Serializable type, and can hold all the information which is in variable B. for example, B is of type XML-DOM tree and C of Type String. Which two solutions, when combined, maintain the state of the session bean over a passivation and activation by the container? (Choose two.)

Options

  • AThe value of helper variable C is used to create the value of Instance variable B in the beans no- arg
  • BThe value of helper variable C is used to create the value of instance variable B in a @postcreate annotated
  • CThe value of helper variable C is used to create the value of instance variable B in a @postActivate
  • DInstance variable A must be made null and instance variable B must be converted to a Serializable type and
  • EInstance variable A must be defined transient. Instance variable B must be converted to a Serializable type,

How the community answered

(21 responses)
  • A
    5% (1)
  • B
    10% (2)
  • C
    71% (15)
  • D
    14% (3)

Community Discussion

No community discussion yet for this question.

Full 1Z0-895 Practice