• 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

MDB instance variable holding state

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In chapter 3 on Frits EJB 3.1 notes, its been stated that

A Message Driven bean instance variables can contain state across the handling of messages (e.g. database connection or reference to an enterprise bean).

Q1. Can MDB contain reference to stateful session bean?
Q2. With the statement, instance variables can contain state across the handling of messages Are the stateful session bean state is carried over or as per the DI rule when the MDB instance is destroyed, the DI automatically removes the stateful session bean?
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Q1. Can MDB contain reference to stateful session bean?


Yes, however I can't think of a practical use case, as the Stateful Session Bean is always connected to one particuliar client whereas the Message Driven Bean doesn't have a client.

Q2. With the statement, instance variables can contain state across the handling of messages Are the stateful session bean state is carried over or as per the DI rule when the MDB instance is destroyed, the DI automatically removes the stateful session bean?


No, only the MDB.
 
Nandhini Sridharan
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Frits
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic