]
jaikiran pai updated JBAS-7301:
-------------------------------
Fix Version/s: (was: JBossAS-Branch_4_2)
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: