|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.eventstore.jpa.SQLStateResolver
public class SQLStateResolver
SQLStateResolver is an implementation of PersistenceExceptionResolver used to resolve sql state values to see if it violates a unique key constraint.
SQL state codes are standardized - the leading two characters identifying the category. Integrity constraint violations are in category 23. Some database systems further specify these state codes, e.g. postgres uses 23505 for a unique key violation.
Constructor Summary | |
---|---|
SQLStateResolver()
Constructor that uses the standard SQL state category for the check. |
|
SQLStateResolver(String checkState)
Constructor that can be used to supply a specific SQL state code for the check. |
Method Summary | |
---|---|
boolean |
isDuplicateKeyViolation(Exception exception)
Indicates whether the given exception represents a duplicate key violation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SQLStateResolver()
public SQLStateResolver(String checkState)
checkState
- The state string that is used in the check.Method Detail |
---|
public boolean isDuplicateKeyViolation(Exception exception)
PersistenceExceptionResolver
exception
represents a duplicate key violation. Typically, duplicate key
violations indicates concurrent access to an entity in the application. Two users might be accessing the same
Aggregate, for example.
isDuplicateKeyViolation
in interface PersistenceExceptionResolver
exception
- The exception to evaluate
true
if the given exception represents a Duplicate Key Violation, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |