• 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

share stateful session bean among stateless session beans

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am quite new to EJB so please bear with me :-) I am trying to write an ejb web application that has multiple stateless session beans thah share a stateful session. The latter provides methods tha use data read from database. That is, the SLSBs inject the SFSB and use it in their methods. The intended reason is to share the same information and code, instead of having multiple DB lookup points for each SLSB. In some cases I also directly use the stateful session bean from presentation tier.
Now this does not work since the SFSB injected is a different instance for each SLSB, and this causes trouble when its data gets modified, and its state is not shared to other SLSBs. So my question is: is it possible to share an SFSB instance among multiple SLSBs? Is it a crazy idea (this thread seems to suggest so)? And in that case what would be a better solution?

Thank you,
Marco
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic