Question about Stateless Session Beans and creation

J

john_hilgedick

All,

I've got a pretty straight forward question that I haven't been able to
find the answer to with regards to stateless session beans and
creation. My question is, once a clientA invokes a method on a bean
instance X, can another clientB invoke a method on bean instance X
before clientA finishes?

I've been assuming that this is possible - that's it's really up to the
application server (jboss, jrun, weblogic, etc) to determine this for
themselves. Because of this assumption, I've been very wary about
storing things like database connections inside my stateless session
bean's instance variables. I'd hate to have clientA come along, grab
access to bean instance X, create a connection and store it in bean
instance X and then, before clientA is finished with the bean, clientB
comes along, notices that connection that clientA stored inside the
bean instance, and uses it. You could see how this could cause I
problem.

Am I being too cautious? Is it really possible for 2 or more clients
to be accessing the same bean instance at the same time?

Any light you can shed would be appreciated.

Thanks,

-john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top