deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John D. Ament" <john.d.am...@gmail.com>
Subject Re: Advice on accessing @RequestScoped bean in service thread
Date Thu, 21 Jul 2016 17:20:20 GMT
Ludovic,

Are you using context control to start a request context on the websockets
thread?

On Jul 21, 2016 13:16, "l.penet@senat.fr" <l.penet@senat.fr> wrote:

> Hi.
>
> I am looking for an advice on how to acces a request scoped bean in a
> service thread. My current need is in a web socket service thread, but it
> could be any background thread.
>
> The bean I need to access is a data access bean, which will itself request
> injection of an entity manager to perform various operations. It does in
> fact nothing related to the HTTP session, but I want to be sure that every
> requests gets a clean bean.
>
> How do you recommend to do that ? If I boldly try to une
> BeanProvider.getContextualInstance(), it does not work as there is, of
> course, no request scope. Should I start a pseudo request scope ? Is there
> an annotation for that ?
>
> Thanks in advance,
>
> Ludovic
>
>
> |
> | AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
> |
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message