Thanks for your reply. In regard to your example about multiple
threads making database calls via the JDBC api, concurrency issues
will arise only if any of the objects (connection, statement,
resultset) are members of the class. If they are locally defined,
which I believe it should in the case of stateless session EJB(SSB),
then it should not matter whether it is being called by a single
thread or multiple threads. I am trying to understand what is special
about the SSB that does not allow concurrent access. Obviously this is
the reason that SSB's are pooled in order to handle multiple requests.
My understanding of this makes be want to say that only one instance
of an SSB is sufficient to handle any number of requests. What do you
say?
Thanks!
Raj
> Thanks for your reply. In regard to your example about multiple
> threads making database calls via the JDBC api, concurrency issues
[quoted text clipped - 3 lines]
> then it should not matter whether it is being called by a single
> thread or multiple threads.
You have completely missed the point, which is that SSBs are allowed to
have member variables without restriction, and to use them in the
execution of their methods. Declaring a session bean "stateless" in its
deployment descriptor is a promise about its behavior, not a statement
about its structure. The promised behavior is that the execution of a
business method by any client will never change the result of a later
execution of the same or any other business method on behalf of the same
or any other client. It is about how the _container_ can use instances
to fulfill requests.
> I am trying to understand what is special
> about the SSB that does not allow concurrent access. Obviously this is
> the reason that SSB's are pooled in order to handle multiple requests.
Again, you have missed the point. _Nothing_ is special about SSBs or
any other kind of EJB with regard to concurrent access, which is exactly
why they are not suitable for concurrent access. I gave you the
skeleton of a viable example of an SSB that in fact has a real
concurrency problem.
> My understanding of this makes be want to say that only one instance
> of an SSB is sufficient to handle any number of requests. What do you
> say?
I say reread what I wrote before, and what I have written above. If you
want a truly authoritative answer then the ultimate resource is the EJB
spec, available free from Sun. You seem to be making assumptions about
the meaning of "stateless" that are not appropriate in this context, so
if you read the spec then take care to not read in requirements that are
not actually there. If it is not in the spec then it is not a requirement.
John Bollinger
jobollin@indiana.edu
> Thanks!
>
[quoted text clipped - 42 lines]
>>John Bollinger
>>jobollin@indiana.edu