Which two solutions, when combined, maintain the state of the session bean over a passivation and activation by the container?

A stateful session bean contains a number of instance variables. The types of instance variables A
and B are NOT 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.)

A stateful session bean contains a number of instance variables. The types of instance variables A
and B are NOT 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.)

A.
The value of helper variable C is used to create the value ofinstancevariableBin the beans noarg constructor.

B.
Thevalueofhelper variable C is usedtocreate the value ofinstancevariableBin a @PostCreate
annotated method.

C.
The value ofhelpervariable C isusedto create the value of instance variableBin a@PostActivate
annotated method.

D.
Instancevariable A must be made null and instance variable B mustbeconverted toaSerializable
type and assigned to anotherinstancevariable in a @PreDestroy annotated method.

E.
Instance variableAmustbedefinedtransient.Instance variableBmustbe convertedtoaSerializable
type,set to null,and assigned totheinstancevariableC ina@PrePassivate annotatedmethod.



Leave a Reply 0

Your email address will not be published. Required fields are marked *