Multithreading in EJB - Please Help Me out

Discussions

EJB programming & troubleshooting: Multithreading in EJB - Please Help Me out

  1. Multithreading in EJB - Please Help Me out (2 messages)

    Hai,

    I have a serious problem. As you have already aware of EJB doesn’t support multi-threading. Is there any way, other than JMS(Messaging Service), can I solve the problem of multi-threading.

    I have to do the following in my application :

    I have a Chat Component (EJB Component) which is invoking some method in my Room Component (it is also an EJB Component). Can I proceed with any other process
    in my Chat Component, before my Room Component method finishes its execution.
    I need to do some other process parallelly running with my first request made to the Room Component in the Chat Component.

    Or shall I have to wait for the Room Component method to finishes its execution

  2. If you really want to use Multithreading programming, you may have to change the client code structure. For example,
    you can create two threads in the client code (do not create
    threads in your bean code which will corrupt EJB server). And in the run() methods of two threads, you can invoke the
    bean methods. Also you can use all the threads synchoronization techniques.

    Fengliang
  3. Hi,
    Do you have any examples for this for a EJB Client and Server?

    Thanks.

    A