• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stateless Session Bean -> MDB (Thread)

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stateless Session Bean should call two operations concurrently. Since EJB does not allow multi-threading, can i call two different MDB for each thread ?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kri,
The MDBs would be asynchronous. Is this what you want? You don't have any guarantee they will run concurrently.

Also, who calls your stateless session bean? Can it launch the threads?
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Who calls your stateless session bean? Can it launch the threads?
Servlet calls stateless session bean. It can't launch threads.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From a Session EJB method, you can sequentially place two messages on two message ques.

The two Message-Driven EJB that are connected to these message ques will process the message on their message que in their own thread.

Whatever logic that happens from each Message-Driven EJB will occur concurrently.

Keep in mind that you should not code business logic in the Message-Driven EJB code. So, whatever logic that occurs with message should either be in a Session EJB or a POJO business object.
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From a Session EJB method, you can sequentially place two messages on two message ques.
Is it Statefull Session bean or Stateless Session Bean ?
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't matter.
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From a Session EJB method, you can sequentially place two messages on two message ques. Each message has its own Thread. Hence i guess parallely place two messages on two message queues.
 
reply
    Bookmark Topic Watch Topic
  • New Topic