4 Replies Latest reply on Jan 17, 2008 1:03 PM by pmuir

    Removing Stateful Session Beans from the Session gracefully

    oberiko

      Hello,

      I'm currently in the midst of (slowly) teaching myself how to use Seam. In my "myFirstProject" project, I've got two pages, one which saves entities to the database, and another which pulls them out, lists them and allows the user to delete them. Each screen can navigate to the other.

      For my list, I'm using a Stateful Session Bean (SFSB) in the session scope. When I go back to the entry screen and add more users, naturally they won't appear on the list screen since its drawing on a list currently in the session (populated by a "@factory" method)

      I've been looking around, but I can't seem to find how to properly remove objects from the session scope properly when they are no longer needed.

      Am I supposed to call the "destroy()" method when I go back to the entry screen?

      Should I instead change this into the conversation scope (which seems a bit much for a single list page) and add a "@begin" and "@end"?

      Is there a much more elegant solution I'm simply overlooking?