title: @Lock(LockType.READ) Singleton Ejb in java 8
body: <p>Using Java 7 with Jboss7 the following code used to work.</p>
  
  <pre><code>@Singleton
  public class OperacaoServiceImpl implements OperacaoService {
  
      private Operacao operacaoEmAndamento;
  
      @Override
      @Lock(LockType.READ)
      public Operacao getOperacaoEmAndamento() {
          return operacaoEmAndamento;
      }
  
      @Override
      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
      public void geraEIniciaOperacao() throws CoreException {
          geraOperacao();
          iniciaOperacao();
  
      }
  }
  </code></pre>
  
  <p>Now I've migrated to Java 8 with Wildfly it stopped working. If geraEIniciaOperacao is still running, I can't access getOperacaoEmAndamento.</p>
  
  <blockquote>
    <p>" javax.ejb.ConcurrentAccessTimeoutException: WFLYEJB0241: EJB 3.1
    PFD2 4.8.5.5.1 concurrent access timeout on OperacaoServiceImpl -
    could not obtain lock within 5000MILLISECONDS     at
    org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:106)
    ..."</p>
  </blockquote>