Annotation Interface CrdbRetry


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface CrdbRetry
Retries the annotated method on CockroachDB serialization anomalies (SQLSTATE 40001 / 40P01) using adaptive exponential backoff.

Unlike Transactional, this annotation does not open a transaction; it simply re-invokes the method body. Combine with Transactional for transactional retry, or use standalone around an already-transactional unit.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    long
    Base delay between attempts, in milliseconds.
    long
    Upper bound on any single backoff delay, in milliseconds.
    int
    Maximum number of retry attempts before giving up.
  • Element Details

    • maxRetries

      int maxRetries
      Maximum number of retry attempts before giving up.
      Default:
      5
    • baseDelayMillis

      long baseDelayMillis
      Base delay between attempts, in milliseconds.
      Default:
      100L
    • maxDelayMillis

      long maxDelayMillis
      Upper bound on any single backoff delay, in milliseconds.
      Default:
      5000L