Interface ConditionalUpdateInterface
- All Known Implementing Classes:
MemoryConditionalUpdateAction,RDBMSConditionalUpdateAction
public interface ConditionalUpdateInterface
Backend capability CONDITIONAL_UPDATE: an atomic compare-and-set update.
Sets the given values on every row of one table that matches the filter, as
ONE atomic statement (for an RDBMS: UPDATE t SET ... WHERE ...), and returns
how many rows changed. Callers use it as a compare-and-set: put the expected
current values (e.g., id and a version counter) in the filter, and check the
count. Two concurrent callers with the same expectation can never both win.
This is a low-level store operation for kernels such as durable jobs: it does
not run audits, automations, record security or field validation. Only the
table's own fields may appear in the filter (no joins).
The backend also exposes its clock, so callers that compare times across pods
(leases) use one clock instead of each pod's own.
-
Method Summary
Modifier and TypeMethodDescriptiondatabaseNow(QBackendMetaData backend) The backend's current time (for an RDBMS, the database clock).intexecute(ConditionalUpdateInput input) Run the update; return the number of rows updated.
-
Method Details
-
execute
Run the update; return the number of rows updated.- Throws:
QException
-
databaseNow
The backend's current time (for an RDBMS, the database clock).- Throws:
QException
-