Annotation Type TransactionConfiguration


  • @Inherited
    @Target({METHOD,TYPE})
    @Retention(RUNTIME)
    public @interface TransactionConfiguration
    This annotation can be used to configure a different transaction timeout than the default one for a method or a class.

    When defined on a method, it needs to be used on the entry method of the transaction.

    If defined on a class, it is equivalent to defining it on all the methods of the class marked with @Transactional. The configuration defined on a method takes precedence over the configuration defined on a class.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      int timeout
      The transaction timeout in seconds.
      String timeoutFromConfigProperty
      The configuration property to use in order to determine the value of the timeout in seconds.
    • Field Detail

      • UNSET_TIMEOUT

        static final int UNSET_TIMEOUT
        This value is used to specify that no transaction timeout is configured.
      • UNSET_TIMEOUT_CONFIG_PROPERTY

        static final String UNSET_TIMEOUT_CONFIG_PROPERTY
    • Element Detail

      • timeout

        int timeout
        The transaction timeout in seconds. Defaults to UNSET_TIMEOUT: no timeout configured.
        Returns:
        The transaction timeout in seconds.
        Default:
        -1
      • timeoutFromConfigProperty

        String timeoutFromConfigProperty
        The configuration property to use in order to determine the value of the timeout in seconds. If the property exists, it must be an integer value representing the transaction timeout in seconds. An example configuration in application.properties could be: my-transaction.timeout=5. If both timeoutFromConfigProperty and timeout are set, then Quarkus will attempt to resolve timeoutFromConfigProperty and if a value for it has been provided, the timeout is set to that value. If no value has been provided at runtime for the property, then the value of timeout will be used as the fallback.
        Default:
        "<<unset>>"