[jboss-jira] [JBoss JIRA] Created: (JBAS-7301) JBoss v4.2.3 GenericJDBCException

Gaurav Bansal (JIRA) jira-events at lists.jboss.org
Wed Sep 30 05:09:50 EDT 2009


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
             Fix For: JBossAS-Branch_4_2


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