I need to write something similar to OracleExceptionSorter Class of Jboss where I need to take some specific action for specific SQLException Error Code. My question is when hibernate throws exception is the first level of Exception always one of the following:
* class org.hibernate.exception.ConstraintViolationException
* class org.hibernate.exception.DataException
* class org.hibernate.exception.GenericJDBCException
* class org.hibernate.exception.JDBCConnectionException
* class org.hibernate.exception.LockAcquisitionException
* class org.hibernate.exception.SQLGrammarException
So I can always do something like
Code:
try{
}catch(GenericJDBCException e){
OracleExceptionSorter e = new OracleExceptionSorter();
e.isFatal(e.getSQLException());
}
Code for OracleExceptionSorter:
http://docs.jboss.org/jbossas/javadoc/4 ... .java.htmlSo my questions:
1. Is first level of exception one of the above Exceptions?
2. Does GenericJDBCException and JDBConnectionException always have SQLException and error code associated with it?