11 Replies Latest reply on Mar 9, 2010 5:12 PM by Arbi Sookazian

    ConversationScoped state can be destroyed at any time?

    Matthijs A Newbie

      Hi there all,

      I am currently thinking if the CDI ConversationScope would be a good replacement of the JSF 2 ViewScope.

      However, in the CDI spec and in the Weld documenation I read something that might give me the idea that state in that has ConversationScope can be destroyed at any time, if the container whishes so. Is that correct?

      I am referring to paragraph 5.3.3 of the Weld documentation that can be found here where it says: The container is permitted to destroy a conversation and all state held in its context at any time in order to conserve resources. A CDI implementation will normally do this on the basis of some kind of timeout—though this is not required by the specification.

      Then in the JSR 299 spec I see in chapter 6.7.4: “The container is permitted to arbitrarily destroy any long-running conversation that is associated with no current JSF request, in order to conserve resources.”

      So does that mean that when a JSF request is over and some state is still preserved in a long running conversation, waiting for the next JSF request, the container can just destroy that conversation?

      Hope anyone can make that clear to me.
      Great spec and Weld documentation by the way!