This content has been marked as final.
Show 3 replies
-
1. Re: SFSB not removed when conversation ends?
kapitanpetko Oct 22, 2008 1:25 PM (in response to kapitanpetko)Adding ctx.flush() to destroy() changes nothing. SFSB's are still left over.
-
2. Re: SFSB not removed when conversation ends?
kapitanpetko Oct 23, 2008 6:06 AM (in response to kapitanpetko)It seems that SFSB's are not removed if the conversation is a temporary one.
Here's what (I think) happens:
- Conversation ended by @End or pages.xml
- @Remove @Destroy destroy() is called
- RemoveInterceptor calls ServerConversationContext#remove(). That results in the component's name being added to ServerConversationContext#removals.
- When ServerConversationContext.flush() is called, names in the removals list are not actually removed from the session, because the conversation is temporary (see *** below)
public void flush() { boolean longRunning = !isCurrent() || Manager.instance().isLongRunningConversation(); if ( longRunning ) { //force update for dirty mutable objects for (String key: getNamesForAllConversationsFromSession()) { Object attribute = session.get(key); if (attribute!=null) { if (passivate(attribute) || isAttributeDirty(attribute)) { session.put(key, attribute); } } } //remove removed objects for (String name: removals) { session.remove(getKey(name)); } removals.clear(); //add new objects for (Map.Entry<String, Object> entry: additions.entrySet()) { Object attribute = entry.getValue(); passivate(attribute); session.put(getKey(entry.getKey()), attribute); } additions.clear(); } else { //TODO: for a pure temporary conversation, this is unnecessary, optimize it // *** Here: getNamesFromSession does not include removals, so they are left over // Should probably be like this: // added code START //for (String name: removals) { // session.remove(getKey(name)); //} //removals.clear(); // added code END for ( String name: getNamesFromSession() ) { session.remove( getKey(name) ); } } }
-
3. Re: SFSB not removed when conversation ends?
kapitanpetko Oct 24, 2008 8:54 AM (in response to kapitanpetko)