[jboss-jira] [JBoss JIRA] (WFLY-7554) Singleton: @AccessTimeout and @Lock on superclass method not
Stefan Lindner (JIRA)
issues at jboss.org
Tue Nov 15 03:20:00 EST 2016
[ https://issues.jboss.org/browse/WFLY-7554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13322447#comment-13322447 ]
Stefan Lindner commented on WFLY-7554:
--------------------------------------
The problem arises if MySuperClass is not part of the deplomyment unit of MyClass.
This means:
# MySuperClass is part of say "common-lib.jar". This is a module in .../modules/my/common-lib/...
# MyClass is part of a deployment unit, say "my-deployment.jar", in standalone/deployments
# my-deplymnet.jar references common-lib.jar
The question is: is this intended by the standard that only says something about
{quote}@AccessTimeout can be specified on a business method or on a bean class (or super-class){quote}
and
{quote}Access timeouts for a singleton session bean only apply to methods eligible for concurrency locks.{quote}
So the methods of MySuperClass might not be "eligible" but the annotations at class level sould be. Or did I missunderstood this totally?
> Singleton: @AccessTimeout and @Lock on superclass method not
> -------------------------------------------------------------
>
> Key: WFLY-7554
> URL: https://issues.jboss.org/browse/WFLY-7554
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Affects Versions: 9.0.2.Final, 10.1.0.Final
> Environment: Win7_64, Oracle Java 8/102
> Reporter: Stefan Lindner
> Assignee: Stuart Douglas
>
> {code:java}
> @AccessTimeout(value=54321)
> class MySuperclass {
> @AccessTimeout(value=1200000000000L)
> public void whileBlocked() {....}
> }
> @Singleton
> @Startup
> @ConcurrencyManagement(ConcurrencyManagementType.CONTAINER)
> @DependsOn("BenutzerControllerImpl")
> @AccessTimeout(value=54321)
> @Lock(LockType.READ)
> class MyClass extends MySuperclass {
> @Lock(LockType.WRITE)
> public void myBlocker() {....}
> }
> {code}
> Calling method {code:java}whileBlocked{code} when another thread has called {code:java}myBlocker{code} leads to Exception
> javax.ejb.ConcurrentAccessTimeoutException: WFLYEJB0241: EJB 3.1 PFD2 4.8.5.5.1 concurrent access timeout on MyClass - could not obtain lock within 5000MILLISECONDS
> The standard says:
> {quote}The AccessTimeout annotation can be specified on a business method or on a bean class (or superclass).
> {quote}
> In short:
> # @AccessTimeout annotations on bean's class or method work as expected
> # Annotations on superclass do not
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list