-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathIntegrityConstraintFailedException.java
40 lines (34 loc) · 1.23 KB
/
IntegrityConstraintFailedException.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Made with all the love in the world
* by scireum in Remshalden, Germany
*
* Copyright by scireum GmbH
* http://www.scireum.de - [email protected]
*/
package sirius.db.mixing;
import java.io.Serial;
/**
* Wraps all database specific exceptions to signal that an integrity constraint was violated.
* <p>
* Sometimes we use a constraint like "UNIQUE" to detect certain race conditions or other parallel behaviour
* without the need for locking. The occurrence of such an error then needs to be handled properly
* (i.e. by retrying an operation). Therefore some methods (e.g. {@link BaseMapper#tryUpdate(BaseEntity)}
* throw this dedicated exception to permit the application code to handle this case properly.
*/
public class IntegrityConstraintFailedException extends Exception {
@Serial
private static final long serialVersionUID = -3178562817868475776L;
/**
* Creates a new instance without any reference to another error.
*/
public IntegrityConstraintFailedException() {
}
/**
* Creates a new instance with a reference to the given cause.
*
* @param cause the cause of this error
*/
public IntegrityConstraintFailedException(Throwable cause) {
super(cause);
}
}