Announcement Announcement Module
Collapse
No announcement yet.
Session Timeout Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Session Timeout

    Hello,

    I have a question about transaction timeouts. The Hibernate and JDBC transaction managers both support transaction timeouts:

    http://www.springframework.org/docs/...onManager.html
    http://www.springframework.org/docs/...onManager.html

    However, I cannot find an example anywhere on how to apply a timeout value. Could somebody point me to a URL or provide a sample Spring XML configuration that would allow me to specify a timeout?

    Thanks!
    Patrick

  • #2
    You can apply a declarative timeout with a "timeout_" prefix:
    Code:
      ...
      <property name="transactionAttributes">
        <props>
          <prop key="get*">PROPAGATION_REQUIRED,readOnly,timeout_15</prop>
          ...
        </props>
        ...
      </property>
      ...
    this will specify a timeout of 15 seconds.
    HTH

    Comment


    • #3
      I did see that the string that you specified for the transaction is defined by TransactionAttributeEditor (http://www.springframework.org/docs/...uteEditor.html). It certainly helps to be able to specify a timeout per transaction/method.

      However, the JavaDocs for the above class say the following:

      "Timeout values are in seconds. If no timeout is specified, the transaction manager will apply a default timeout specific to the particular transaction manager."

      I am curious how I would apply a default timeout value for a transaction manager, like for the HibernateTransactionManager for example. The JavaDocs imply that a default value can be set, but I have yet to find out how.

      Thanks for your help!
      Patrick

      Comment

      Working...
      X