Bug #91439 upgrade guide needs to inform of removed/refactored exceptions
Submitted: 27 Jun 2018 13:44 Modified: 12 Oct 2018 19:50
Reporter: Chris Cheshire Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Documentation Severity:S3 (Non-critical)
Version:8.0.x OS:Any
Assigned to: CPU Architecture:Any

[27 Jun 2018 13:44] Chris Cheshire
Description:
Using Connector/J 5.1.x I was catching instances of com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException to handle primary key violations.

In 8.0.x, this package has been removed without prior deprecation, leading to compilation errors.

The fix is to catch java.sql.SQLIntegrityConstraintViolationException instead. Other exceptions appear to have just changed packages within Connector/J.

The upgrade guide needs to reflect the package changes for exceptions (and possibly other things) in order to get existing code to compile.

How to repeat:
.
[28 Jun 2018 5:36] MySQL Verification Team
Hello Chris,

Thank you for the report!

Thanks,
Umesh
[12 Oct 2018 19:50] Daniel So
Posted by developer:
 
Added to Upgrading to MySQL Connector/J 8.0  > Changes (https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-other-changes.html):

+ MySQLIntegrityConstraintViolationException has been removed; catch java.sql.SQLIntegrityConstraintViolationException instead.