Class SkipLockedClaims

java.lang.Object
com.kingsrook.qqq.backend.core.jobs.store.SkipLockedClaims

public final class SkipLockedClaims extends Object
Claims with SELECT ... FOR UPDATE SKIP LOCKED (spec section 2.13, item 5): in one short transaction, lock candidate rows other claimers have not locked, then claim them (the fenced conditional update still bumps leaseVersion) and commit. Competing pods skip each other's rows instead of racing for the same ones. Backends without it use conditional updates only.
  • Method Details

    • isSupported

      public static boolean isSupported(String tableName)
      Whether the table's backend supports FOR UPDATE SKIP LOCKED.
    • claim

      public static <T> T claim(String tableName, QQueryFilter filter, SkipLockedClaims.Claimer<T> claimer) throws QException
      Lock the filter's rows (skipping locked ones) and claim them, in one transaction (as the system user).
      Throws:
      QException