• 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic