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 Spec VS HFEJB(ejbCreate)

 
Ramakrishna Allam
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on pg 192 , EJB spec says that CreateException is a must for ejbCreate.
on page 335 in HFEJB , its not ...
please clarify...
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must declare javax.ejb.CreateException for the ejbCreate() method of an entity bean, but this is optional for a session bean (see p96 of the EJB spec).
For a message-driven bean, the ejbCreate() method must not declare any application exceptions.
 
Ramakrishna Allam
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much . Its a great point . I could not observe that . Looks like i need to see everything very clearly .
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice explanation, Roger Chung-Wee... Thanks for it...
 
Ramakrishna Allam
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chung,I think its true for irrespective of the statefull ness of the bean (its true for both stateful and stateless beans) .And , all the create methods in remote homes muct throw CreateException. Isnt it?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think its true for irrespective of the statefull ness of the bean (its true for both stateful and stateless beans)

Correct.
And , all the create methods in remote homes muct throw CreateException. Isnt it?

The create() method of a remote home interface must always declare both a javax.ejb.CreateException and a java.rmi.RemoteException. This applies to session and entity beans. Of course, none of this applies to message-driven beans as they have no client.
 
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!