Both are correct.

Nothing prevents you from opening two browsers and issuing two 
simultaneous requests to the servlet layer.
Usually for performance reason, the servlet does NOT implement
the SingleThreadModel, so the requests are handled into possibly
2 different threads.

If the servlets are talking to SFSB, as they do not support concurrent
access, the EJB container will throw an exception.

BUT, I do consider the BluePrint solution as a HACK because most
real-world implementation out there are in a cluster, so the use
of a the synchronized keyword is useless.

I think that some vendors (like Weblogic) have a specific flag to
serialize calls on SFSB in a cluster. But it is not in the spec.

The spec does not address the issues of concurrent access from
a multithread client AFAIK, may be for J2EE 1.4 ;-)

Thierry

=>-----Original Message-----
=>From: JavierG [mailto:[EMAIL PROTECTED]]
=>Sent: 23 July 2001 15:32
=>To: [EMAIL PROTECTED]
=>Subject: reentrant beans
=>
=>
=>Hi:
=>
=>In "Mastering Enterprise Java Beans" Roman states that, and I 
=>quote: "When
=>you call a method on a session bean instance, your EJB 
=>container guarantees
=>that no other clients are using that instance[...]Thus, if 
=>multiple clients
=>simultaneusly invoke methods on a session bean, they invocations are
=>serialized, or performed in lock-step..." but then, in the 
=>Java Blueprints
=>you can see things like this:
=>
=>"Code Example 10.14 contains an excerpt from ShoppingClientController-
=>WebImpl. Notice that all the methods of ShoppingClientController are
=>synchronized
=>so that concurrent requests to ShoppingClientController are 
=>serialized.
=>This is done because an EJB container will throw an exception 
=>if a request
=>is made
=>to a session bean while it is servicing another request.
=>public class ShoppingClientControllerWebImpl
=>{
=>private com....ejb.ShoppingClientController sccEjb;
=>private HttpSession session;
=>public ShoppingClientControllerWebImpl(HttpSession session) {
=>this.session = session;
=>ModelManager mm =
=>(ModelManager)session.getAttribute("modelManager");
=>sccEjb = mm.getSCCEJB();
=>}
=>public synchronized AccountModel getAccount() {
=>CHAPTER 10 THE SAMPLE APPLICATION 288
=>return sccEjb.getAccount().getDetails();
=>}
=>...
=>public synchronized Collection handleEvent(EStoreEvent ese) {
=>return sccEjb.handleEvent(ese);
=>}
=>public synchronized void remove() {
=>sccEjb.remove();
=>}
=>}
=>Code Example 10.14 ShoppingClientControllerWebImpl"
=>
=>I'm I missing something? According to Roman the EJB container 
=>*guarantees*
=>thread safe access to the bean instances...
=>Sorry if this a silly question, but I do see a contradiction here.
=>Sincerelly
=>   J.
=>
=>==============================================================
=>=============
=>To unsubscribe, send email to [EMAIL PROTECTED] and 
=>include in the body
=>of the message "signoff EJB-INTEREST".  For general help, 
=>send email to
=>[EMAIL PROTECTED] and include in the body of the message "help".
=>
=>


************************************************************@~|!+
This email and any attachments are confidential and are intended for the addressee(s) 
only.
If you are not the intended recipient, please notify the sender immediately by reply 
email
and then delete it from your system. Any disclosure, forwarding or copying of this 
email or
its attachments is expressly prohibited.
************************************************************@~|!+

==========================================================================To 
unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to