• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Container handles exception thrown from timeout callback method?

 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On p.394, table 23-24 of JSR 318, the container does not throw the system exception to the client from timeout callback methods in either CMT or BMT.

But on p.524, session 18.4.3 Timer Expiration and timeout callback method, it says


If the timer is a single-event timer, the container must cause the timer to no longer exist. If a javax.ejb.Timer interface method is subsequently invoked on the timer
after the completion of the timeout callback method, the container must throw the javax.ejb.NoSuchObjeectLocalException.



The Timer and TimerHandle methods can throw EJBException and etc. So, I believe the container should throw those exceptions to the client.

I think table 23-24 miss the fact that container throws the system exception.


This case is different from what we discussed in the previous post :https://coderanch.com/t/646025/java-EJB-SCBCD/certification/container-throw-EJBException-timeout-callback
In the previous post, the container throws the system exception when a transaction fails to commit.
But in this post, I think the EJBException (system exception) thrown from the instances of Timer or TimerHandle should be propagated to the container and the container will throw the EJBExceptions back the client.
 
Himai Minh
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I may be able to answer my own question.
The methods of Timer or TimerHandle can throw an EJBException and this exception will be propagated to the container. The container will throw the exception to the client.
But if the @timeout callback method throws an EJBException, this exception will be logged by the container. But the container will not throw this exception back tot he client.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic