4 Replies Latest reply on Dec 23, 2011 10:13 AM by jaikiran

    ConcurrentAccessTimeoutException

    prinzm

      Hi!

       

      We have a JSF web-project deployed on JBoss AS 7.1 Beta 1.

      Sometimes we get this exception:

       

      14:23:59,520 ERROR [org.jboss.ejb3.invocation] (http-10.99.0.10-10.99.0.10-8080-5) JBAS014134: EJB Invocation failed on component VehicleServiceBean for method public abstract java.util.List com.hji.common.service.VehicleService.findVehiclesBySearchCriteriaAndImporterIds(com.hji.common.domain.repository.VehicleRepository$VehicleSearchCriteria,java.lang.String,java.util.List,boolean): javax.ejb.ConcurrentAccessTimeoutException: JBAS014360: EJB 3.1 FR 4.3.14.1 concurrent access timeout on org.jboss.invocation.InterceptorContext@5e01cd - could not obtain lock within 5000 MILLISECONDS

       

      How can this happen? Before we moved to JBoss 7, we used the @SerializedConcurrentAccess annotation in our stateful beans. Is there any way to prevent this exception from happening, maybe using @AccessTimeout ?

       

      Best regards

      Mike

        • 1. Re: ConcurrentAccessTimeoutException
          sfcoy

          The @SerializedConcurrentAccess annotation looks like an extension that is not implemented in JBossAS 7. Spec wise stateful session beans are not required to be reentrant. At least it's nice enough to wait 5 seconds before giving up.

           

          Is it possible that users are getting impatient and clicking the "Find" button again?

           

          I'm guessing that this issue is related to your other database access issues.

          • 2. Re: ConcurrentAccessTimeoutException
            jaikiran

            EJB3.1 spec has this for stateful session beans:

             

            4.3.14.1Stateful Session Bean Concurrent Access Timeouts

             

            @AccessTimeout is used to specify the amount of time a stateful session bean request should block in the case that it can’t immediately access a bean instance that is already processing a different request. If an access attempt times out, the container throws a javax.ejb.ConcurrentAccessTimeoutException to the client. @AccessTimeout can be specified on a business method or on a bean class (or super-class).

             

            @AccessTimeout specified on a class applies the access timeout to all business methods of that class. If @AccessTimeout is specified on both a class and on a business method of that class, the method-level annotation takes precedence.

            • 3. Re: ConcurrentAccessTimeoutException
              sfcoy

              So Mike should be able to specify:

              @AccessTimeout(-1)

               

              and get the behaviour that he used to get with @SerializedConcurrentAccess?

              • 4. Re: ConcurrentAccessTimeoutException
                jaikiran

                Stephen Coy wrote:

                 

                So Mike should be able to specify:

                @AccessTimeout(-1)

                 

                and get the behaviour that he used to get with @SerializedConcurrentAccess?

                Actually, I intentionally left that part out In JBoss AS7 (and even 6) we don't allow stateful bean requests to wait indefinitely. So in case of -1, we just default to the default accesstimeout that's configured at the subsystem level (which is 5 seconds).