• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Keerthi P
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic