1 Reply Latest reply on Jan 12, 2010 7:13 PM by Emir Calabuch

    Seam conversation's unpredictable end

    Nikola Racic Newbie

      Hi all,


      I have Bean which starts Seam conversation, and when I start that conversation with @Begin I also put the timestamp in the DB when conversation starts.


      After that when user finish their actions and triggers @End method, I also put timestamp, so at the end I have duration of user's interaction with my service - conversation (which is requirement for my project).


      What happens if user starts conversation regularly and then click close button on browser or network failure happens or something else other than regular @End method trigger. How can I listen for conversation end if that situations occur and put end time in the DB?


      Thanks a lot

        • 1. Re: Seam conversation's unpredictable end
          Emir Calabuch Newbie

          When conversations are not ended regularly, they are timed out (the timeout interval is adjustable in components.xml). So, you could listen for the org.jboss.seam.conversationTimeout event, which passes the conversation id as a parameter, and registers the end time in the event handler (transactions could be a problem, though).


          The ConversationEntry also registers the time at which the conversation was last used (it could be more reasonable than the time at which the event is raised).