Win a copy of High Performance Python for Data Analytics this week in the Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

confused about declarations in HFEJB

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im confused about some declarations in HFEJB...

BEAN PROVIDER�S RESPONSABILITIES (page 544)

1.- If you bussines logic catches (or creates) an application exception, throw it to the container as the application exception.

My question....
--- if i can handle an application exception by a try/catch block, why do i still have to throw it to the container?

5.- if your bussines generates an application exception, you must had declared the exception in both your client interface and you bean class

My Question...
---- if i can handle an application exception by a try/catch block, why do i still have to declare it?

And one more confusion:

THERE ARE NO DUMP QUESTIONS (PAGE 545)
Question:
Q: ... Does this mean that you can�t throw an application exception from sar, ejbActivate()?;
Answer:
that�s right�... you can trhow only unchecked exceptions from the container callbacks....

an just a few pages later:

SCENARIOS(page 547)

You catch checked exception in you ejbActivate method the method is not into a transaction

what do i supossed to belive? (can or can't) i throw a checked exception from de container callbacks? (ejbActivate(), ejbPassivate()...)

can anybody explain me this?... thanks
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jezreel Canav:
im confused about some declarations in HFEJB...

BEAN PROVIDER�S RESPONSABILITIES (page 544)


My question....
--- if i can handle an application exception by a try/catch block, why do i still have to throw it to the container?



Because the client wants to know it as well



My Question...
---- if i can handle an application exception by a try/catch block, why do i still have to declare it?



Same as before


And one more confusion:

THERE ARE NO DUMP QUESTIONS (PAGE 545)
Question:
Q: ... Does this mean that you can�t throw an application exception from sar, ejbActivate()?;
Answer:
that�s right�... you can trhow only unchecked exceptions from the container callbacks....

an just a few pages later:

SCENARIOS(page 547)

You catch checked exception in you ejbActivate method the method is not into a transaction

what do i supossed to belive? (can or can't) i throw a checked exception from de container callbacks? (ejbActivate(), ejbPassivate()...)

can anybody explain me this?... thanks



Technically you could declare a checked exception in a container callback method, but the specifications clearly state that the container should treat all the exceptions thrown in a container callback method the same, i.e. as system exceptions, regardless of the type of exception.

Marco
[ September 04, 2004: Message edited by: Marco Tedone ]
 
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic