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

confused about declarations in HFEJB

 
Jezreel Canav
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic