This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Gurus, what methods a CMP entity bean must and must not implement ?

 
Mikalai Zaikin
Ranch Hand
Posts: 3381
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, EJB Gurus !
Reading EJB Specs for topic

Identify the interfaces and methods a CMP entity bean must and must not implement.

I can not realize, is it *mandatory* to provide implementations for ALL
callback methods from EntityBean interface (ejbLoad, ejbStore, ejbPassivate, ejbActivate) ? Even empty .... I suspect that we MUST provide even empty, but for what reason ? And where it written in specs ?
Since class will *alwayls* be abstract, we MAY omit some methods implemenations from interface (according for *general* Java rules).
But, CAN we do this in EJB ?
Thanks.
 
Mike Cogan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mikalai,
First thanks for the positive feedback (27/10/03) on JDiscuss regarding www.revisingscbcd.co.uk much appreciated.
To understand why you need to implement these methods you need to understand how the container works and how it provides callback methods to the entity bean (also what callback methods are). You may find it useful reading the EJB specification starting at about 10.7.7 (regarding entity bean lifecyle).
I will be posting some examples of entity beans soon on my site so it may be worth running through a few of them to get to grips with what is actually happening to the "empty" methods.
Good luck with the exam,
Mike Cogan
[ November 14, 2003: Message edited by: Mike Cogan ]
[ November 14, 2003: Message edited by: Mike Cogan ]
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!