This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Home Business Methods

 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I was going through HF EJB and found that, in an Entity bean code, home business methods do not declare Remote Exceptions. Whereas other methods like create method / finder method do declare exceptions.
Can anybody tell me why home business methods cannot declare Remote Exceptions?

Thanks and Regards,
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gowda
Business method in the remote home interface required to throw java.rmi.remote exception
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops, sorry.
My question has to be like this
Implementation of ejbCreate methods in session beans do not declare CreateException in bean code.
Implementation of ejbCreate methods in entithy beans do declare CreateException in bean code.
This i am not sure, i saw a piece of code in HFEJB, when i was reading chapter 5 - Entity bean synchronization.
Is it really entity beans can declare exceptions(other than custom exceptions) when implementing create / finder methods in bean class.


Thanks and Regards
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gowda
The EJB spec says you must define CreateException in the throws clause of ejbCreate<method> the spec says
page 192 10.6.4

The throws clause must define the javax.ejb.CreateException. The throws clause may define
arbitrary application specific exceptions.
 
Saurabh Chaubey
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Awishek, can you explain if the CreateException should also be declared in the throws clause of the Session Beans...or not.
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CreateException for session bean is not mandatory
the spec says
page 96 7.10.3
The throws clause may define arbitrary application exceptions, possibly including the
javax.ejb.CreateException
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic