1 Reply Latest reply on Feb 7, 2005 5:52 PM by tumusr

    EJB Session Bean sharing common resource

    stan2w

      Hi all,

      I am new to EJB and I am now using JBOSS to do some development.

      I have written a stateless session bean and I would like to know if the
      bean is thread safe. Since, my session bean has a static object, I
      would like to have all my bean instances sharing a common object. My
      guess is each session bean is not thread safe. So, can anyone give me
      some suggestion to get around this problem.

      The idea is I would like to have all instances of my session bean to
      share a common resource. The common resource may be a huge byteBuffer
      (I don't want all my bean instance has its own copy for space reason)
      or it has a socket to communicate with another process outside of the
      VM.

      I really want to use the best option available to tackle this problem,
      then I will have a better understanding how EJB works.

      Thanks!!!