public class OptimisticLockRetryInterceptor
extends org.drools.core.command.impl.AbstractInterceptor
org.hibernate.StaleObjectStateException
and only
then attempt to retry.
Since this is Hibernate specific class another can be given as system property to override default. Name of the
system property org.kie.optlock.exclass
and its value should be fully qualified class name of the
exception that indicates OptimisticLocking.
By default it will:
Modifier and Type | Field and Description |
---|---|
protected Class<?> |
targetConstraintViolationExceptionClass |
protected Class<?> |
targetExceptionClass |
Constructor and Description |
---|
OptimisticLockRetryInterceptor() |
Modifier and Type | Method and Description |
---|---|
<T> T |
execute(org.kie.api.command.Command<T> command) |
long |
getDelay() |
long |
getDelayFactor() |
int |
getRetries() |
Class<?> |
getTargetExceptionClass() |
protected boolean |
hasInterceptorInStack() |
protected boolean |
isCausedByConstraintViolationFailure(Throwable throwable) |
protected boolean |
isCausedByOptimisticLockingFailure(Throwable throwable) |
void |
setDelay(long delay) |
void |
setDelayFactor(long delayFactor) |
void |
setRetries(int retries) |
void |
setTargetExceptionClass(Class<?> targetExceptionClass) |
protected Class<?> targetExceptionClass
protected Class<?> targetConstraintViolationExceptionClass
public <T> T execute(org.kie.api.command.Command<T> command)
protected boolean isCausedByOptimisticLockingFailure(Throwable throwable)
protected boolean isCausedByConstraintViolationFailure(Throwable throwable)
public int getRetries()
public void setRetries(int retries)
public long getDelay()
public void setDelay(long delay)
public long getDelayFactor()
public void setDelayFactor(long delayFactor)
public Class<?> getTargetExceptionClass()
public void setTargetExceptionClass(Class<?> targetExceptionClass)
protected boolean hasInterceptorInStack()
Copyright © 2001–2016 JBoss by Red Hat. All rights reserved.