• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Home Business Methods

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
I am not young enough to know everything. - Oscar Wilde This tiny ad thinks it knows more than Oscar:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic