tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romych <>
Subject Re: EJB timers stop working.
Date Wed, 11 Feb 2015 15:32:13 GMT
@Timeout    private void timeout(Timer timer) {        final EventConfig
config = (EventConfig) timer.getInfo();       
beanManager.fireEvent(config.getEvent(), config.getQualifiers());    } 
There may be problem in concurency management. May be previous work hangs
inside timeout method. Then timer can not call timeout method, it works like
synchronized.You may try to annotate singleton class with 
@ConcurrencyManagement(ConcurrencyManagementType.BEAN).And use something
about on timeout method:
private static final Lock inTimer = new ReentrantLock();@Timeoutprivate void
timeout(Timer timer) {    if (inTimer.tryLock(5000, TimeUnit.MILLISECONDS))
{      try {	doWork();      } finally {	inTimer.unlock();      }    } else {
logger.warn("Can not get lock!");    }}
So you can see where problem is.

View this message in context:
Sent from the TomEE Users mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message