Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

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

 
Because those who mind don't matter and those who matter don't mind - Seuss. Tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic