Win a copy of AWS Security 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Some doubts on - Mikalai Zaikin study material - Entity beans

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am having some doubts on the study guide provided by, Mikalai Zaikin.
Please clarify the same.
Notation, i will type every thing from the material in quotes and my doubts without quotes.

1. Chapter 7 -- Section - "Identify correct and incorrect statements or examples about the life cycle of a CMP entity bean. "
In Material one of the buller point says -- "The container CAN choose to passivate an entity bean instance WITHIN a transaction. To passivate an instance, the container first invokes the ejbStore() method to allow the instance to prepare itself for the synchronization of the database state with the instance�s state, and then the container invokes the ejbPassivate() method to return the instance to the POOLED state."
Doubt --> Is it possible to passivate the bean, if the bean is in the transaction? the same is not possible in the case of statefull session beans.

2. Chapter 7 -- Section --"Identify correct and incorrect statements or examples about the life cycle of a CMP entity bean. "
In Material one of the buller point says -- "The container will transition the instance to the pooled state. There are THREE possible transitions from the ready to the POOLED state -- Because of a transaction rollback for ejbCreate(), ejbPostCreate(), or ejbRemove(). "
Doubt --> If the transaction is rolled back in ejbRemove() method, where will be the bean ? Is it in pooled state or method ready. Ideally it is in method ready state, because from the state bean wants to move to the pooled state, because the transaction is rolled back, hence the bean will not move to the pooled state. Is it correct?

3. Chapter 7 -- Section --"Identify correct and incorrect statements or examples about the life cycle of a CMP entity bean. "
In Material one of the buller point says --"A RuntimeException thrown from any method of an entity bean class (including the business methods and the callbacks invoked by the container) results in the transition to the DOES NOT EXIST state. From the caller�s perspective, the corresponding entity object CONTINUES to exist. The client CAN continue accessing the entity object through its component interface because the container can use a different entity bean instance to delegate the client�s requests. "
Doubt --> In entity beans, if the client gets the RuntimeException, can he continue with that EJBObject? Will the container creates new instance of the bean for the client?

4. EJB-QL --
Doubt --> From the select statement can i select the multiple cmp fields, i.e. "select e.name, e.empno from employee as e"

Thanks in Advance..
 
The harder you work, the luckier you get. This tiny ad brings luck - just not good luck or bad luck.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic