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

Container handles exception thrown from timeout callback method?

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • 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 :http://www.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
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic