3 Replies Latest reply on Nov 26, 2007 5:21 AM by Pete Muir

    maintain state between pages and seam managed persistence co

    nguyen giang Newbie

      Hi all,

      In our system, user can navigate from page P1 -> P2 -> P3...,
      and navigate back from ...P3 -> P2 -> P1(every page has a "go back" button).
      When navigating back, state of previous pages must be restored.
      There is a navigating history bar on all page, and user can skip navigate from P3 -> P1.
      This is a normal pattern.

      Before using seam, we store page state in http session before navigating to next page,
      and remove these state from session before navigating back to avoid memory leak.
      This is a normal solution.

      From seam manual, we conclude that:
      1. "Long running conversation(LRC) is used if we need to maintain state between pages/request"
      (LRC is best used in modify entity page or wizard style page)

      2. "seam-managed persistence context(SMPC) is scoped to conversation,
      means that SMPC is kept open until conversation end"

      If using LRC in our case, SMPC keep open until navigating back
      to the first page or when LRC times out.
      This solution is impossible because SMPC will hold/cache a huge amount of entity.

      Is that our page flow pattern is not suitable with Seam LRC ?

      Is there another way to solve this?

      Please give some advice.