org.jcreme.sql
Class DeadLockException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.sql.SQLException
              extended byorg.jcreme.sql.DeadLockException
All Implemented Interfaces:
java.io.Serializable

public class DeadLockException
extends java.sql.SQLException

This class enables to precise the nature of an SQLException. When a deadlock is detected, this class enables to report it and eventually handle it (for instance by repeating the query a number of times).

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.lang.Exception
 
Constructor Summary
DeadLockException(java.lang.String reason, java.lang.String sqlState, int vendorCode)
          Creates a new DeadLockException.
 
Method Summary
 boolean getWasBatchStatement()
          Gives access to the wasBatchStatement flag.
 void setNextException(java.sql.BatchUpdateException exc)
          Adds a BatchUpdateException object to the end of the chain.
 void setNextException(java.sql.SQLException exc)
          Adds a SQLException object to the end of the chain.
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeadLockException

public DeadLockException(java.lang.String reason,
                         java.lang.String sqlState,
                         int vendorCode)
Creates a new DeadLockException.

Parameters:
reason - a description of the exception.
sqlState - an XOPEN or SQL 99 code identifying the exception
vendorCode - a database vendor-specific exception code
Method Detail

setNextException

public void setNextException(java.sql.BatchUpdateException exc)
Adds a BatchUpdateException object to the end of the chain. The flag wasBatchStatement is also set to true.

Parameters:
exc - the new exception that will be added to the end of the SQLException chain.

setNextException

public void setNextException(java.sql.SQLException exc)
Adds a SQLException object to the end of the chain. The flag wasBatchStatement is also set to false.

Parameters:
exc - the new exception that will be added to the end of the SQLException chain.

getWasBatchStatement

public boolean getWasBatchStatement()
Gives access to the wasBatchStatement flag.

Returns:
true if the statement that threw this exception was a Batch Statement, false otherwise.


Copyright 2006 null. All Rights Reserved.