HHH-7034 : java.sql.SQLTimeoutException should be mapped to org.hibernate.QueryTimeoutException

This commit is contained in:
Gail Badner 2012-02-08 00:50:58 -06:00
parent 199d08210d
commit edda5ec7f4
1 changed files with 2 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import java.sql.SQLTransactionRollbackException;
import java.sql.SQLTransientConnectionException;
import org.hibernate.JDBCException;
import org.hibernate.QueryTimeoutException;
import org.hibernate.exception.ConstraintViolationException;
import org.hibernate.exception.DataException;
import org.hibernate.exception.GenericJDBCException;
@ -82,8 +83,7 @@ public class SQLExceptionTypeDelegate extends AbstractSQLExceptionConversionDele
return new SQLGrammarException( message, sqlException, sql );
}
else if ( SQLTimeoutException.class.isInstance( sqlException ) ) {
// there are no corresponding sql states for this type
return new GenericJDBCException( message, sqlException, sql );
return new QueryTimeoutException( message, sqlException, sql );
}
else if ( SQLTransactionRollbackException.class.isInstance( sqlException ) ) {
// Not 100% sure this is completely accurate. The JavaDocs for SQLTransactionRollbackException state that