This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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..
 
Hot dog! An advertiser loves us THIS much:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!