Avoid expunging timer on glassfish

后端 未结 2 2014
伪装坚强ぢ
伪装坚强ぢ 2020-12-04 16:00

I have a method annotated with @Schedule that is called by the container once in a while.

@Schedule(second = \"*/5\", minute = \"*\", hour = \"*\", persisten         


        
2条回答
  •  臣服心动
    2020-12-04 16:29

    The current Glassfish up to version 4 expunges a timer if during the execution of the timeout callback method an application exception occurs.

    The application exception causes a rollback of the current transaction. In such a situation Glassfish retries the error free execution of the timeout callback method once again. If a rollback again occurs Glassfish expunges the timer.

    I filed an issue in the Glassfish issue tracker not to expunge the timer in case of an excpetion. Glassfish seems to be the only application server who expunges a timer in case of an application exception. See glassfish #20749: Glassfish expunges timer even if callback method keeps its contract for more details. May you would like to vote for my issue.

    I also filed an issue on the EJB specification to clarify how the EJB container should behave in such situations. See ejb-spec #111: Please clearify the behaviour of an container if an application exception is thrown during the execution of a timer callback method for more details.

提交回复
热议问题