Mantis - Resin
Viewing Issue Advanced Details
5891 minor always 05-01-15 16:03 06-03-15 08:50
bbik  
ferg  
normal  
closed 4.0.44  
fixed  
none    
none 4.0.45  
0005891: Cancelled ejb timers returned by getTimers()
Not sure, is it a bug, buy I suppose so.
After cancellation, timers are returned by getTimers:

@Singleton
@LocalBean
@Startup
public class TimerTest
{
    @Resource
    TimerService ts;
    static TimerTest inst;
    @PostConstruct
    void init()
    { inst=this;
    }
    public synchronized static TimerTest getInstance()
    { return(inst);
    }
    public Collection<Timer> getTimers()
    { Collection <Timer> res=ts.getTimers();
        return(res);
    }
    public void cancelAll()
    { for(Timer ot: ts.getTimers())
        {
                System.out.println("Found old timer "+ot.getInfo()+", cancelling it.");
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Exception here on second+ call:
 javax.ejb.NoSuchObjectLocalException: "This timer has been cancelled."
                ot.cancel();
        }
    }

Thank you

There are no notes attached to this issue.