|
From: Bansal, G. (Gaurav) <gb...@av...> - 2009-09-29 09:19:27
|
Hi,
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 highlighted text in the above
code extract. 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. We are
now using the modified jar file in the JBoss AS.
I would like to understand following aspects from licensing perspective:
1. Can we use the JBoss with modified code in our product that will
ship to various customers?
2. What is the procedure to contribute the modified code back to
the community?
3. Are the there any licensing requirements that needs to be
complied with before using the JBoss' modified source code?
Thanks,
Gaurav
|