We have a Singleton EJB class that looks like this:
@Singleton
@Startup
@ConcurrencyManagement(ConcurrencyManagementType.CONTAINER)
@Lock(LockType.READ)
public class FooImpl implements Foo {
@PostConstruct
public void init() {
//...
}
@Override
public Object method1(String str, Object obj) { /*...*/ }
@Override
public Object method2(String str, Object obj) { /*...*/ }
And we have noticed that if we move the annotation @Lock(LockType.READ) from the class level to its methods, then we get stuck threads sometimes:
which is more than the configured time (StuckThreadMaxTime) of "600" seconds in "server-failure-trigger". Stack trace:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
com.oracle.common.base.Blocking.parkNanos(Blocking.java:153)
com.oracle.common.base.Blocking.park(Blocking.java:137)
that points precisely to the methods.
Why this change provoked this issue? Shouldn't the behaviour be the same in this case either the annotation is at class level or not? Is this somehow specific to Weblogic server?
There are no LockType.WRITE in other parts of the class.