-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Exception Handler
PostPosted: Sun Aug 23, 2009 1:10 am 
Newbie

Joined: Wed Oct 22, 2008 2:56 pm
Posts: 10
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.html

So 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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.