Win a copy of Head First Android this week in the Android forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis


Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is difference b/w stateless session bean and MDB.
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MDB or Message Driven Bean are in use when you have to communicate with some JMS servers to achive an Asynchronous communication , or when you want to use some queue to listen on them or when you want to subscribe into some topics in a JMS server.
we use MDB is two way
1- publish/subscribe pattern
usually we use them when we have to announce some events to more than one intrested entity , for example you want to tell 2 or more (dynamicly changes) application that stock price is changed , so they all can update thier status.
in this scenario one who announce the change is a publisher and those application who are intrested in stock change are subscriber. i should tell that subscribers and publishers could be dynamically change.
2-Point-to-Point Messaging
you can use this scenario when you want to delive a message to one and only one listener. in this type you have a queue and some clients on the queue.
in this scenario whichever listener who recive and take the message from queue will own the message and no one else will be allowd to use it.

JMS has some features like :
1-delivery guarantee.
2-persistent message
3-usually failover , Clustring capability

A session bean is a logical executer of an application.
you can do your business process in a session bean , for example you can check user authentication in a session bean, you can execute create , find , insert .... over your Entity beans from inside a session bean ...

an stateless session bean could be used for operations that are the same for all users . for example to execute a query , to insert a record ...
when you need to keep track of a user actions and execute an action based on user profiles then you should use an statefull session bean.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic