This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line!
See this thread for details.
Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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

 
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.
 
Ranch Hand
Posts: 211
  • 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.
 
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.
 
Space pants. 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