java - GenericJDBCException catched by wrong part of the try/catch block -
i have block of code:
} catch (hibernateexception e) { loginanswer = new logincustomerareaanswer(999); //this function use error code save inside loginanswer this.logop.error(logsutilities.logexception(e, "hibernateexception")); } catch (exception e) { loginanswer = new logincustomerareaanswer(997); //this function use error code save inside loginanswer this.logop.error(logsutilities.logexception(e, "exception")); } { return loginanswer; }
as can see, catch first hibernateexception type exception , generic exception.
but when log file, when have org.hibernate.exception.genericjdbcexception exception catched generic exception!
why?, genericjdbcexception not "a son" of hibernateexception? not have catched hibernateexception??
this example of log file
2013-05-21 11:01:02 [level: error]*** exception: error code: 997 - not open hibernate session transaction; nested exception org.hibernate.exception.genericjdbcexception: cannot open connection
i lost this, can me?
most caught spring exception:
org.springframework.transaction.cannotcreatetransactionexception: not open hibernate session transaction; nested exception org.hibernate.exception.genericjdbcexception: cannot open connection
Comments
Post a Comment