Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Activities in each method of CMP Entity Bean

Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Method of CMP Entity Bean :
1. setEntityContext(EntityContext);
2. ejbActivate
3. ejbPassivate
4. ejbLoad
5. ejbStore
6. ejbFindByPrimaryKey (Not declare in bean class) managed by Container.
7. ejbCreate<METHOD>
8. ejbPostCreate
9. ejbHome<METHOD>
10. abstract ejbSelect<METHOD>
I confuse about process can be occur/use in each method such as
ejbPassivate method can be set value of non-transient variable....
setEntityContext ? and so on ....

Thank you very much for all answer.
Cowgirl and Author
Posts: 1589
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy --
The best advice I can give for this is to look at page 179 and 180 in the EJB 2.0 spec. There's a table that includes virtually everything that matters as far as the test objective that wants to know if you know what's allowed and what is not allowed in each method.
Now... this is perhaps one of the hardest areas of the exam because you really do have to know these. But most of them make sense if you really stop to think about it. So, trying to just memorize them all will be difficult, but if you try to understand why some things are allowed and some aren't, most will make perfect sense, and then you won't need to rely so much on memorization.
An exercise in the book is a table that lists each of the methods, and then there is a checklist for you to check off depending on whether that operation is allowed from within that method. It's just another way of recreating the table on 179 and 180 (but easier to read, I think).
The checklist is like this:
Use your EntityContext to: [/BOLD]
* getEJBHome
* getEJBLocalHome
* getCallerPrincipal
* getRollbackOnly
* isCallerInRole
* setRollbackOnly
* getEJBObject
* getEJBLocalObject
* getPrimaryKey
* java:comp/env
* a resource manager (like a JDBC connection)
* another bean's methods
* your own CMR fields
So, using the checklist above, go through the following list of methods, and decide which things in the list above can -- or cannot -- be done in that method:
* constructor (not a method, but still...)
* setEntityContext / unsetEntityContext
* ejbCreate
* ejbPostCreate
* ejbRemove
* ejbHome
* ejbActivate / ejbPassivate
* ejbLoad / ejbStore
* business method from component interface
It really will make a HUGE difference if you try to work this out yourself, rather than trying to memorizing the spec pages.
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic