Discussions

EJB design: Threading delegate in EJB

  1. Threading delegate in EJB (3 messages)

    I would like to know whether threading can be done by a normal class in a
    EJB server which will be called by a bean.

    For eg: I have to retrieve around 2000 rows each from 10 different tables
    and aggregate them and send it to the client.
    So instead of sequentially accessing each table, can i write a class A which
    implements Runnable and spawns ten threads for acessing each table and
    aggregating the values(to be passed to the bean which will pass it to the
    client)?

    Does this violate the EJB specs or is an acceptable workaround?

    Regards
    vinoth.c

    Threaded Messages (3)

  2. Threading delegate in EJB[ Go to top ]

    According to EJB specifications, you cannot call or use Threads from inside the EJB container.

    -JC
  3. Threading delegate in EJB[ Go to top ]

    This does indeed violate the EJB spec. One option would be to use JMS and a Message Driven Bean to simulate multiple threads.

    Dave Wolf
    Internet Applications Division
    Sybase
  4. Threading delegate in EJB[ Go to top ]

    Hai dave,

    Will you give me with small snippet code how
    to do threading in JMS.----(1)

    Architecture
    Applet will invoke EJB.EJB inturn call JMS.JMS
    will give the results back to the EJB component.
    The component wil response back to the
    applet.
    Am i right------------------(2)

    Regards,
    Vinoth.C