tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: EJB timers stop working.
Date Wed, 11 Feb 2015 21:32:45 GMT
cause of @Lock(LockType.READ) it shouldn't be the case


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2015-02-11 16:32 GMT+01:00 romych <romychs@mail.ru>:
> @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: http://tomee-openejb.979440.n4.nabble.com/EJB-timers-stop-working-tp4673750p4673755.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Mime
View raw message