Comments (8)
Reported by stuartdouglas
from ejb-spec.
@ldemichiel said:
The EJB 3.1 Expert Group made the decision to assign this semantics to AccessTimeout(0) instead of introducing something like a ConcurrencyManagementType.CONCURRENCY_NOT_ALLOWED value.
I think this annotation is mostly useful to override for a method behavior that is specified at class level.
from ejb-spec.
@ldemichiel said:
Not a bug
from ejb-spec.
stuartdouglas said:
There is already a way to do that though (@lock(WRITE) @AccessTimeout(0)). It seems really silly that if you do @lock(READ) @AccessTimeout(0) two threads cannot call the method at the same time, even though @lock(READ) explicitly allows this behaviour.
This basically has the effect of transparently turning a READ lock into a WRITE lock, for no good reason (if the user wanted a write lock they would have use @lock(WRITE)).
from ejb-spec.
@ldemichiel said:
Combining the two annotations doesn't make a lot of sense to me. I think the intention was to treat AccessTimeout as an override over any concurrency. That is different from turning a READ lock into a WRITE lock, because there is no waiting involved for the lock to free up – instead one just gets the ConcurrentAccessException. BTW, I'm certainly not disagreeing with your general point about lack of intuitiveness in the design though.
from ejb-spec.
stuartdouglas said:
I think it makes sense. Intuitively AccessTimeout(0) means 'I don't want this thread to block, if you can't get the lock straight away throw an exception', so if it is applied to a read lock I would expect that if another thread holds the write lock an exception will be thrown, otherwise the thread would proceed as normal.
With the current wording there can be situations where the current thread can take the lock immediately (as there are only other read threads active), however it still has to throw an exception because of the 'no concurrency' stipulation.
from ejb-spec.
This issue was imported from java.net JIRA EJB_SPEC-122
from ejb-spec.
Marked as works as designed on Monday, September 15th 2014, 1:54:49 pm
from ejb-spec.
Related Issues (20)
- Add pause() and resume() to TimerService HOT 2
- Spec bug regarding tx attributes for timeout methods HOT 2
- Allowing business interface inheritance HOT 2
- Update project lead in JIRA HOT 13
- Clarification whether persistent timers have to survive redeployment / undeployment HOT 7
- clarify ThreadLocal usage in ejb environment HOT 12
- Explicitly allow Java 8 default methods as business methods HOT 3
- Incorrect description/examples for interceptor-binding DD element HOT 3
- Allow listener method to always be determined at runtime by resource adapter HOT 6
- Define a standard way to specify the resource adapter used by a JMS MDB HOT 4
- Annotation-based Bean-Pool Configuration HOT 2
- Annotation-based Transaction Timeout Configuration HOT 5
- Identity scheduled for removal HOT 3
- Typo in bind of interceptors HOT 2
- EJB RMI-IIOP over HTIOP(Http2 or WebSocket) HOT 2
- clarify ManagedExecutorService task execution allowance in @PostConstruct method for @Startup Singleton Session Bean HOT 9
- EJB 3.2 spec section 14.2 Enterprise bean's name needs clarification HOT 1
- evaluate Java EE 7 spec section 5.2.2 for possible clarification in relation to EJB 3.2 spec portable JNDI lookup
- EJBContext.getCallerIdentity should be removed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ejb-spec.