You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openwebbeans.apache.org by titou10 <ti...@gmail.com> on 2013/07/26 22:07:36 UTC

conversation.end() + conversation.begin() in the same method?

Hi,
We want to end() the current conversation and begin() a new one a the end of the request.

Is this correct to code:

@Inject private Conversation conversation;
public String doSomeBusinessStuff(){
   ...
   conversation.end();
   conversation.begin();
   return "/some/prettyPage.jsf?faces-redirect=true";
}

It *seems* to work but is this correct? What does really happen here?
- the current conversation is terminated at the end of the request as per the CDI 1.0 spec
- then a new one is started..at the begining of the next one (ie the begin() is queued somewhere) ?
When calling begin(), I can't find anywhere where exactly the conversation is promoted to a LRC? immediately? at the end of the 
request? In our case after the end() has been processed?

Is this the correct way to achieve this?
Thx