Skip to content

Commit

Permalink
Fix bug with removing non-persistent timers
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Aug 3, 2011
1 parent 1e1ce65 commit 3333454
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -214,12 +214,12 @@ public void cancel() throws IllegalStateException, NoSuchObjectLocalException, E
if (currentTx == null) {
// cancel any scheduled Future for this timer
this.cancelTimeout();
// persist changes
timerService.persistTimer(this);
} else {
this.registerTimerCancellationWithTx(currentTx);
}

// persist changes
timerService.persistTimer(this);
}

/**
Expand Down Expand Up @@ -720,6 +720,7 @@ public void afterCompletion(int status) {
case IN_TIMEOUT:
case RETRY_TIMEOUT:
this.timer.cancelTimeout();
timerService.persistTimer(timer);
break;

}
Expand Down
Expand Up @@ -1008,8 +1008,10 @@ public void afterCompletion(int status) {
TimerState timerState = this.timer.getState();
switch (timerState) {
case ACTIVE:
if (this.timer.isPersistent()) {
timerPersistence.removeTimer(this.timer.getPersistentState());
}
this.timer.setTimerState(TimerState.CANCELED);
timerPersistence.removeTimer(this.timer.getPersistentState());
break;
}

Expand Down

0 comments on commit 3333454

Please sign in to comment.