Package org.camunda.bpm.engine.impl
Class HistoryLevelSetupCommand
- java.lang.Object
-
- org.camunda.bpm.engine.impl.HistoryLevelSetupCommand
-
-
Constructor Summary
Constructors Constructor Description HistoryLevelSetupCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidacquireExclusiveLock(CommandContext commandContext)protected voidcheckStartupLockExists(CommandContext commandContext)static java.lang.IntegerdatabaseHistoryLevel(CommandContext commandContext)static voiddbCreateHistoryLevel(CommandContext commandContext)protected voiddetermineAutoHistoryLevel(ProcessEngineConfigurationImpl engineConfiguration, HistoryLevel databaseHistoryLevel)java.lang.Voidexecute(CommandContext commandContext)booleanisRetryable()When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted.
-
-
-
Method Detail
-
execute
public java.lang.Void execute(CommandContext commandContext)
-
dbCreateHistoryLevel
public static void dbCreateHistoryLevel(CommandContext commandContext)
-
databaseHistoryLevel
public static java.lang.Integer databaseHistoryLevel(CommandContext commandContext)
- Returns:
- Integer value representing the history level or
nullif none found
-
determineAutoHistoryLevel
protected void determineAutoHistoryLevel(ProcessEngineConfigurationImpl engineConfiguration, HistoryLevel databaseHistoryLevel)
-
checkStartupLockExists
protected void checkStartupLockExists(CommandContext commandContext)
-
acquireExclusiveLock
protected void acquireExclusiveLock(CommandContext commandContext)
-
isRetryable
public boolean isRetryable()
When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted. CockroachDB uses a stricter, SERIALIZABLE transaction isolation which ensures a serialized manner of transaction execution. A concurrent transaction that attempts to modify the same data as another transaction is required to abort, rollback and retry. This also makes our use-case of pessimistic locks redundant since we only use them as synchronization barriers, and not to lock actual data which would protect it from concurrent modifications. The HistoryLevelSetup command only executes internal code, so we are certain that a retry of a failed command will not impact user data, and may be performed multiple times.- Specified by:
isRetryablein interfaceCommand<java.lang.Void>- Returns:
- true if the
CrdbTransactionRetryInterceptorcan make a transparent retry of this command upon failure with aCrdbTransactionRetryException(only used when running on CockroachDB).
-
-