web application in linux environment throws javax.ejb.ConcurrentAccessTimeoutException Unable to get read lock on singleton ejb method

Refresh

April 2019

Views

2 time

0

I have deployed EJB web application in tomcat,linux machine. This application connects to AWS RDS through JNDI lookup that presents in @singleton ejb class. Every minute my application prints the DB content in console. In initial startup of application, DB connection is achieved once using @PostConstruct method. After RDS failover, connection to the RDS db is not available anymore. Now I am getting the following error with the stack trace every minute instead of the DB content in console,

Only in Linux Enivironment This error is thrown for almost 30 minutes(@Timeout method is scheduled to run every minute to display DB content). After 30 minutes everything is okay and application works fine.

** In Windows** after failover application works normally (i.e after 2 minutes) RDS fails over in 2 minutes usually!!

javax.ejb.ConcurrentAccessTimeoutException: Unable to get read lock on getABC()' method for: com.test.TestEJB

 at org.apache.openejb.core.singleton.SingletonContainer.aquireLock(SingletonContainer.java:348)
        at org.apache.openejb.core.singleton.SingletonContainer._invoke(SingletonContainer.java:253)
        at org.apache.openejb.core.singleton.SingletonContainer.invoke(SingletonContainer.java:221)
        at org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:265)
        at org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:260)
        at org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:89)

Could this the issue be related to OS or anything else!??

0 answers