Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do we need throw exception in ejbCreate() method??

 
Paul Yen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I read HFEJB book, it only throws exception in Home interface but not in the bean class for create() method. I download the example code from the website of HFEJB. In that CustomerBean code, I saw it declares throw CreateException in ejbCreate() method. I just confused about this. Is this needed or not?? Cuz when I deploy it without put that exception in ejbCreate(), it failed. With it, I can deploy it without any problem. Any one has experience on this?
Thanks.
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Throwing CreateException in the create() methods of the home interface is mandatory for both Session and Entity beans.
Throwing CreateException is also mandatory for the corresponding ejbCreate()methods of the entity beans, but optional for Session beans.
Usually we declare CreateException at both the places for all beans.
There are many people who have read/reviewed Kathy's book in the SCBCD forum. I am sure you would get more answers there for ur specific question.
 
Paul Yen
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Vish!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic