[jboss-jira] [JBoss JIRA] Commented: (JBAS-7301) JBoss v4.2.3 GenericJDBCException
jaikiran pai (JIRA)
jira-events at lists.jboss.org
Wed Sep 30 05:46:49 EDT 2009
[ https://jira.jboss.org/jira/browse/JBAS-7301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12487866#action_12487866 ]
jaikiran pai commented on JBAS-7301:
------------------------------------
Gaurav has volunteered to provide a patch.
> JBoss v4.2.3 GenericJDBCException
> ---------------------------------
>
> Key: JBAS-7301
> URL: https://jira.jboss.org/jira/browse/JBAS-7301
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: JCA service
> Affects Versions: JBossAS-4.2.3.GA
> Environment: RHEL v 5.3, JDK 1.6_11
> Reporter: Gaurav Bansal
> Assignee: Jesper Pedersen
> Original Estimate: 1 day
> Remaining Estimate: 1 day
>
> We are using JBoss AS v 4.2.3. We found that in case of database specific exception for constraints (like unique , referential integrity), we are getting GenericJDBCException and not database specific exceptions like ConstraintViolationException.
> On debugging we found that we are getting GenericJDBCException due to following code available in the class org.jboss.resource.adapter.jdbc.WrappedConnection which is packaged in the jboss-common-jdbc-wrapper.jar.
> protected SQLException checkException(Throwable t) throws SQLException
> {
> Throwable result = null;
> if (mc != null)
> result = mc.connectionError(t);
> if (result instanceof SQLException) {
> throw (SQLException) result;
> } else {
> throw new NestedSQLException("Error", result);
> }
> }
> As a fix for the problem, we commented the code "Throwable result = null;" .
> After making the above changes, we compiled and build JBoss source code. With the modified jboss-common-jdbc-wrapper.jar, we are now getting correct db exceptions for e.g. incase of unique constraint violation, org.hibernate.exception.ConstraintViolationException is reported.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list