Client and backend. This class is shared: the same code is compiled into your app and into your server, so everything on this page works in both.
public class SqlFailure
- Object
- Throwable
- Exception
- IOException
- SqlFailure
A database error that a caller can act on: a transaction that lost a race
with another one (CONCURRENCY) or a write a constraint refused
(INTEGRITY).
Applications see this type. The backend reports the same failures as its own
ConcurrencyFailureException and DataIntegrityViolationException.
Fields
public static final int CONCURRENCY = 1 | A deadlock, a serialization failure or a lock that could not be had: the transaction can be run again. |
public static final int INTEGRITY = 2 | A unique, foreign key, check or NOT NULL constraint refused the write. |
Constructors
public SqlFailure(int kind, String message) | A failure of kind, CONCURRENCY or INTEGRITY. |
Methods
public int getKind() | CONCURRENCY or INTEGRITY. |
Inherited methods
Field details
CONCURRENCY
public static final int CONCURRENCY = 1A deadlock, a serialization failure or a lock that could not be had: the
transaction can be run again.
INTEGRITY
public static final int INTEGRITY = 2A unique, foreign key, check or NOT NULL constraint refused the write.
Constructor details
SqlFailure
public SqlFailure(int kind, String message)Method details
getKind
public int getKind()CONCURRENCY or INTEGRITY.