• 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

How to get Stateful bean from SessionFacade

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

If anyone could help me with this sequence:

Controller -> SessionFacade -> SFSB by Dependency injection or after SessionFacade I need to use ServiceLocator and then SFSB ... ?

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use DI to inject the SFSB.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is not right to use from Stateless Bean Stateful Bean, in this case state saving does not make sense
 
Vitaliy Kim
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dmitri Ericsson wrote:It is not right to use from Stateless Bean Stateful Bean, in this case state saving does not make sense



Ok, SessionFacade can be Stateful or Stateless, as I understand it's possible to use Stateful -> stateful, but not Stateless -> stateful by DI.

So here is another question, how can I get a link to SessionFacade (SFSB) from my Controller? Controller is not EJB bean... Is it only way through ServiceLocator?
 
Vitaliy Kim
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answers guys!
 
sivan jai
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can have DI in servlets.
EDIT: reading your problem again I'm confused - SFSB is tied to a client so I don't think it is ok to inject it into a servlet. I think my answer is I dont know
I have been using Java for 8 years and I have used SFSB only once so I think I better stay away from this question :-)
reply
    Bookmark Topic Watch Topic
  • New Topic