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 |
---|---|
org.kie.api.runtime.RequestContext |
execute(org.kie.api.runtime.Executable executable,
org.kie.api.runtime.RequestContext ctx) |
long |
getDelay() |
long |
getDelayFactor() |
int |
getRetries() |
Class<?> |
getTargetExceptionClass() |
protected boolean |
hasInterceptorInStack() |
protected org.kie.api.runtime.RequestContext |
internalExecute(org.kie.api.runtime.Executable executable,
org.kie.api.runtime.RequestContext ctx) |
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) |
executeNext, getNext, setNext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected Class<?> targetExceptionClass
protected Class<?> targetConstraintViolationExceptionClass
public final org.kie.api.runtime.RequestContext execute(org.kie.api.runtime.Executable executable, org.kie.api.runtime.RequestContext ctx)
execute
in interface org.kie.api.runtime.ExecutableRunner<org.kie.api.runtime.RequestContext>
execute
in class org.drools.core.fluent.impl.PseudoClockRunner
protected org.kie.api.runtime.RequestContext internalExecute(org.kie.api.runtime.Executable executable, org.kie.api.runtime.RequestContext ctx)
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–2018 JBoss by Red Hat. All rights reserved.