Skip to content

Commit

Permalink
Merge pull request #3777 from jGauravGupta/PAYARA-3494
Browse files Browse the repository at this point in the history
PAYARA-3494 PersistentEJBTimerService not serializable
  • Loading branch information
Pandrex247 committed Feb 25, 2019
2 parents ecd669d + dc81c3c commit 6323838
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2018] [Payara Foundation and/or its affiliates]
// Portions Copyright [2018-2019] [Payara Foundation and/or its affiliates]

package com.sun.ejb.containers;

Expand Down Expand Up @@ -296,7 +296,7 @@ private static class TimerHandleImpl implements TimerHandle {

private final TimerPrimaryKey timerId_;

private final EJBTimerService timerService_;
private transient EJBTimerService timerService_;

public TimerHandleImpl(TimerPrimaryKey timerId, EJBTimerService timerService) {
timerId_ = timerId;
Expand Down Expand Up @@ -338,6 +338,9 @@ private TimerWrapper getTimerInternal()
// Can't store a static ref because in embedded container it can be
// changed by server restart
// Timer handles are only available for persistent timers.
if (timerService_ == null) {
timerService_ = EJBTimerService.getPersistentTimerService();
}

if( timerService_ != null ) {
if( timerService_.timerExists(timerId_) ) {
Expand Down

0 comments on commit 6323838

Please sign in to comment.