• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Activities in each method of CMP Entity Bean

Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Thank you very much.
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic