Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1625

provide a way to recreate a datasource pool - Flushable feature - automatically on SQLException - aka ResetOnError

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      <Resource id="..." type="DataSource">
      ResetOnError = true
      ResetOnErrorMethods = *
      </Resource>
      

      Defaults are:

      • ResetOnError = false
      • ResetOnErrorMethods = getConnection,getXAConnection

      Advanced Configuration:

      • ResetOnErrorMethods supports wildcard but not regex (ie * means all methods and that is it).
      • ResetOnError can take a boolean (on/off behavior) as value or a string. In this last case behavior is the following: if "retry(N)" with N a number it retried N times before throwing an exception, if "N" with N a number it is as if it is "rerty(N)", if a fully qualified name of org.apache.openejb.resource.jdbc.ResettableDataSourceHandler$RetryStrategy it is instantiated passing as constructor parameter a Runnable (task flushing the delegate datasource) and the value itself (which can contain some inline config). If not any of these cases it fails.

        Attachments

          Activity

            People

            • Assignee:
              romain.manni-bucau Romain Manni-Bucau
              Reporter:
              romain.manni-bucau Romain Manni-Bucau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: