Uploaded image for project: 'MyFaces Orchestra'
  1. MyFaces Orchestra
  2. ORCHESTRA-31

No warning/error reported when fetching bean from conversation marked as invalidated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.2
    • None
    • Conversation
    • None

    Description

      If a bean A is within conversation A, and a method on the bean does:

      Conversation.getCurrentInstance().invalidate();
      Object o2 = frameworkAdapter.getBean("A");
      assert(o1 != this);

      The above will fail; the bean is the same one.

      The issue is that the invalidate() actually does nothing because the conversation is currently active; we actually delete the conversation after the method returns. And therefore the getBean() call still returns the same object instance.

      Why is invalidation delayed (ie the Conversation detached from the scope) until the conversation is inactive?

      It would be nice if an error was returned in this case; it doesn't seem useful to return beans from a conversation after the conversation has been invalidated. Or alternately, unlink the conversation from the SpringConversationScope so that a new conversation instance will be created immediately, even if it isn't invalidated, so that we get new instances of the beans returned.

      Attachments

        Activity

          People

            Unassigned Unassigned
            skitching Simon Kitching
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: