aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes If the bean doesn't meet the requirements for passivation. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "If the bean doesn Watch "If the bean doesn New topic
Author

If the bean doesn't meet the requirements for passivation.

Narasimha Rao B.
Ranch Hand

Joined: Aug 26, 2002
Posts: 205
Hi,
Please clarify me the below doubt,

1. If the bean does not meet the requirements for passivation at the end of ejbPassivate method - What will happen? Is it the field which is not meeting the requirements will be simply ignored and the bean is passivated? OR There is a possibility that the container may destroy the bean itself.

2. In one of the material, i saw that the - The container CAN choose to passivate an entity bean instance WITHIN a transaction. -- Is it possible to passivate the entity bean within the transaction, when it is not possible in session beans.


Thanks in Advance.


Narasimha
Keerthi P
Ranch Hand

Joined: Aug 19, 2003
Posts: 203
1. If the bean does not meet the requirements for passivation at the end of ejbPassivate method - What will happen? Is it the field which is not meeting the requirements will be simply ignored and the bean is passivated? OR There is a possibility that the container may destroy the bean itself.

-- The container destroys the bean.

2. In one of the material, i saw that the - The container CAN choose to passivate an entity bean instance WITHIN a transaction. -- Is it possible to passivate the entity bean within the transaction, when it is not possible in session beans.

-- This is not possible. The container cannot passivate an EJB when it is busy in a transaction.


Cheers.<br />Keerthi<br />(SCJP, SCWCD, SCBCD)
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
In addition to 1, the container will throw an IllegalStateException, which is a system exception, and as if such type of exception encountered, the container will then destroy the bean.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Narasimha Rao B.
Ranch Hand

Joined: Aug 26, 2002
Posts: 205
Originally posted by Keerthi P:
1. If the bean does not meet the requirements for passivation at the end of ejbPassivate method - What will happen? Is it the field which is not meeting the requirements will be simply ignored and the bean is passivated? OR There is a possibility that the container may destroy the bean itself.

-- The container destroys the bean.

2. In one of the material, i saw that the - The container CAN choose to passivate an entity bean instance WITHIN a transaction. -- Is it possible to passivate the entity bean within the transaction, when it is not possible in session beans.

-- This is not possible. The container cannot passivate an EJB when it is busy in a transaction.


For question 1 - Is it not wrong to discard the bean instance, if one of the member variable is not meeting the requirements for passivation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: If the bean doesn't meet the requirements for passivation.
 
Similar Threads
Confirmation About Transaction
can entity bean get passivated in the middle of the transaction?
Entity Bean Passiavtion?
Passivate in entity bean within transaction
Passivation of Beans