5 Replies Latest reply: Mar 12, 2012 2:12 PM by Jason Porter RSS

Conversation timeout in Seam3

Louis Engelbrecht Newbie

Hi.


I have some questions regarding conversation timeouts in Seam3 and hope that someone can answer it,


1. Where can I see what the current default/global timeout is for conversation in the current Seam 3?


2. Where and how can I set the default/global timeout?


3. What is a good timeout for conversations? Should conversations have a shorter timeout than sessions and how much shorter?


Thank you.



Louis Engelbrecht

  • 1. Re: Conversation timeout in Seam3
    Jason Porter Master

    Louis Engelbrecht wrote on Nov 24, 2011 06:32:


    Hi.

    I have some questions regarding conversation timeouts in Seam3 and hope that someone can answer it,

    1. Where can I see what the current default/global timeout is for conversation in the current Seam 3?


    I believe that's specified either in the CDI spec or in the CDI implementation.



    2. Where and how can I set the default/global timeout?


    I don't recall, but you can manually change the timeout per conversation when you promote it to a long running conversation.



    3. What is a good timeout for conversations? Should conversations have a shorter timeout than sessions and how much shorter?


    Yes, shorter than a session, it has to be shorter or the same as a session as conversations are sections of a session. How much shorter really depends on your application. There is no general rule.

  • 2. Re: Conversation timeout in Seam3
    Louis Engelbrecht Newbie

    Does anyone know if the functionality mention in http://seamframework.org/Seam3/FacesModule to globally set the conversation timeout is implemented yet.


    In http://seamframework.org/Seam3/FacesModule it states:



     <beans xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:s="urn:java:seam:core" 
       xsi:schemaLocation="
          http://java.sun.com/xml/ns/javaee 
          http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
       
       <s:Conversation>
          <s:specializes/>
          <s:timeout>5000</s:timeout>
       </s:Conversation>
       
    </beans>






    Is the timeout value in milliseconds?


    Louis Engelbrecht

  • 3. Re: Conversation timeout in Seam3
    Jason Porter Master

    Yes, it's milliseconds.

  • 4. Re: Conversation timeout in Seam3
    Anthony O. Newbie

    But that doesn't work (java.lang.Exception: Could not resolve node Conversation in namespace urn:java:seam:core)

     

    I've tried :

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:s="urn:java:ee"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
              <s:Conversation>
                        <s:Specializes/>
                        <s:timeout>2000</s:timeout>
              </s:Conversation>
    </beans>
    

     

     

    And there is seems there are no problem, but actually, my conversations still don't last 2 seconds, but much more. So it is not taken into account.

  • 5. Re: Conversation timeout in Seam3
    Jason Porter Master

    This is at a spec level (the conversation timeout). I suspect the best you'll be able to is manually set the conversation timeout when you begin, or as I said earlier, looking into how each implementation does it.