|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface describes how to handle the exceptions. It enabled to apply specific actions depending on the type of Exception. A handler can centralize the actions to take in an application. Handlers can also be specialized by database vendor.
Field Summary | |
static int |
EXCEPTION_TYPE_LOSS_OF_CONNECTION
Specifies that the exception signals a loss of connection. |
static int |
EXCEPTION_TYPE_PLAIN_DEADLOCK
Specifies that the exception signals a deadlock that did not provoke a rollback. |
static int |
EXCEPTION_TYPE_ROLLEDBACK_DEADLOCK
Specifies that the exception signals a deadlock that provoked a rollback. |
static int |
EXCEPTION_TYPE_UNKNOWN
Specifies that the exception type is not determined. |
static int |
WAS_HANDLED
Specifies that the exception was successfully handled. |
Method Summary | |
int |
getDeadlockTimeout()
This method gives access to the number of milliseconds that the thread will wait for before making a new attempt to resolve a deadlock. |
int |
getNumberOfTries()
This method gives access to the number of attempts that will be done to resolve a deadlock (number of calls to the redo action). |
int |
handleException(java.sql.SQLException e)
This method handles an SQLException. |
int |
handleException(java.sql.SQLException e,
CremeAction rollback,
CremeAction lossOfConnection)
This method handles an SQLException. |
int |
handleException(java.sql.SQLException e,
CremeAction rollback,
CremeAction lossOfConnection,
CremeAction redo)
This method handles an SQLException. |
boolean |
isDeadLock(java.sql.SQLException e)
This method can be used to test an SQLException. |
boolean |
isLossOfConnection(int i)
This method can be used to test a result returned by a handleException method call. |
boolean |
isLossOfConnection(java.sql.SQLException e)
This method can be used to test an SQLException. |
boolean |
isPlainDeadLock(int i)
This method can be used to test a result returned by a handleException method call. |
boolean |
isPlainDeadLock(java.sql.SQLException e)
This method can be used to test an SQLException. |
boolean |
isRolledBackDeadLock(int i)
This method can be used to test a result returned by a handleException method call. |
boolean |
isRolledBackDeadLock(java.sql.SQLException e)
This method can be used to test an SQLException. |
boolean |
isUnknown(int i)
This method can be used to test a result returned by a handleException method call. |
void |
setDeadlockTimeout(int timeout)
This method enables to change the number of milliseconds that the thread will wait for before making a new attempt to resolve a deadlock. |
void |
setNumberOfTries(int number)
This method enables to change the number of tries attempts that will be done to resolve a deadlock (number of calls to the redo action). |
boolean |
wasHandled(int i)
This method can be used to test a result returned by a handleException method call. |
Field Detail |
public static final int WAS_HANDLED
public static final int EXCEPTION_TYPE_UNKNOWN
public static final int EXCEPTION_TYPE_LOSS_OF_CONNECTION
public static final int EXCEPTION_TYPE_ROLLEDBACK_DEADLOCK
public static final int EXCEPTION_TYPE_PLAIN_DEADLOCK
Method Detail |
public int handleException(java.sql.SQLException e)
e
- the exception to handle.
public int handleException(java.sql.SQLException e, CremeAction rollback, CremeAction lossOfConnection)
e
- the exception to handle.rollback
- the action to invoke to rollback.lossOfConnection
- the action to invoke in case of a loss of connection.
public int handleException(java.sql.SQLException e, CremeAction rollback, CremeAction lossOfConnection, CremeAction redo)
e
- the exception to handle.rollback
- the action to invoke to rollback.lossOfConnection
- the action to invoke in case of a loss of connection.redo
- the action to invoke in case of a simple deadlock.
public boolean wasHandled(int i)
i
- an int produced by a handleException method call.
public boolean isUnknown(int i)
i
- an int produced by a handleException method call.
public boolean isLossOfConnection(int i)
i
- an int produced by a handleException method call.
public boolean isRolledBackDeadLock(int i)
i
- an int produced by a handleException method call.
public boolean isPlainDeadLock(int i)
i
- an int produced by a handleException method call.
public boolean isLossOfConnection(java.sql.SQLException e)
e
- an SQLException to test.
public boolean isRolledBackDeadLock(java.sql.SQLException e)
e
- an SQLException to test.
public boolean isPlainDeadLock(java.sql.SQLException e)
e
- an SQLException to test.
public boolean isDeadLock(java.sql.SQLException e)
e
- an SQLException to test.
public int getNumberOfTries()
public void setNumberOfTries(int number)
number
- the number of attempts that will be donepublic int getDeadlockTimeout()
public void setDeadlockTimeout(int timeout)
timeout
- the number of milliseconds that the thread will wait for
before making a new attempt to resolve a deadlock.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |