/** * Destroy a conversation context that is not currently bound to the request, called * due to a timeout. * * @param session the current session, to which both current and destroyed conversation belong * @param conversationId the conversation id of the conversation to be destroyed */ static void destroyConversationContext(Map<String, Object> session, String conversationId) { Context current = getConversationContext(); ServerConversationContext temp = new ServerConversationContext(session, conversationId); conversationContext.set(temp); try { destroy(temp); if ( !Session.instance().isInvalid() ) //its also unnecessary during a session timeout { temp.clear(); temp.flush(); } } finally { conversationContext.set(current); } }