I know that the EJB specification forbids an EJB from creating or managing threads, but what about blocking? For example, I have a bean that needs to add an item to a shared Queue. The custom add method for the queue is synchronized, so is this okay for the bean to call?
Thanks.
-
EJBs and Thread management (4 messages)
- Posted by: Danny B
- Posted on: January 28 2003 16:19 EST
Threaded Messages (4)
- EJBs and Thread management by prajakt deshpande on January 30 2003 02:31 EST
- EJBs and Thread management by Gal Binyamini on January 30 2003 12:46 EST
-
EJBs and Thread management by prajakt deshpande on February 05 2003 04:14 EST
- EJBs and Thread management by Gal Binyamini on February 05 2003 08:50 EST
-
EJBs and Thread management by prajakt deshpande on February 05 2003 04:14 EST
- EJBs and Thread management by Gal Binyamini on January 30 2003 12:46 EST
-
EJBs and Thread management[ Go to top ]
- Posted by: prajakt deshpande
- Posted on: January 30 2003 02:31 EST
- in response to Danny B
The answer to your question lies in the question :
Can I use java.util.vector in EJBs . All its methods are synchronized .
J2EE spec does not prohibit from accessing sync. methods. It only prohibits starting , susoending threads from the ejb methods .
hope it helps
thanx and regards
Prajakt -
EJBs and Thread management[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: January 30 2003 12:46 EST
- in response to prajakt deshpande
Prajakt,
I agree with your bottom line. However, this:
<prajakt>
J2EE spec does not prohibit from accessing sync. methods. It only prohibits starting , susoending threads from the ejb methods.
</prajakt>
Is not completely true. Except for the rule forbidding EJBs from doing thread management, there is also a rule that sais:
<spec>
An enterprise Bean must not use thread synchronization primitives to synchronize execution of multiple instances.
</spec>
This rule is somewhat open for interpretation. For a discussion of this issue see:
http://www.theserverside.com/discussion/thread.jsp?thread_id=17449 -
EJBs and Thread management[ Go to top ]
- Posted by: prajakt deshpande
- Posted on: February 05 2003 04:14 EST
- in response to Gal Binyamini
yes , synchronizing (ejb) methods is alos not allowed . -
EJBs and Thread management[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: February 05 2003 08:50 EST
- in response to prajakt deshpande
Parjakt,
I disagree with your interpretation of the spec. The link I posted contains a pretty broad explanation of that, so I won't repeat it here.
Gal