Bug #20029 | NullPointerException with executeBatch() inserting into longtext column | ||
---|---|---|---|
Submitted: | 23 May 2006 21:49 | Modified: | 16 Jun 2006 22:07 |
Reporter: | P Eger | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / J | Severity: | S3 (Non-critical) |
Version: | 3.1.12 | OS: | Linux (RHEL 4) |
Assigned to: | CPU Architecture: | Any |
[23 May 2006 21:49]
P Eger
[26 May 2006 2:20]
P Eger
Changing line 880 of PreparedStatement from if (this.connection.getContinueBatchOnError()) { to if (this.connection!=null && this.connection.getContinueBatchOnError()) { lets the real exception get through, turns out the MySQL session/connection was expired (correctly) after a delay in use. However, the exception is still being swallowed here, making debugging difficult and possibly not conforming to JDBC spec. Also it seems that this same problem might occur elsewhere in PS.java?
[26 May 2006 4:04]
Mark Matthews
It's not necessarily non-JDBC-compliant, but bad form to throw an NPE in this case (so we'll fix it). JDBC-4.0 is looking to address where specifically drivers need to check for closed connections or statements. In this particular case, the driver just needs to call checkClosed() before letting executeBatch() proceed further.
[16 Jun 2006 22:07]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/7787
[16 Jun 2006 22:07]
Mark Matthews
This should be fixed in the latest builds of Connector/J 5.0 (the fixes to make this robust were too large to go into 3.1). The final release of 5.0.1 will have the fix, or alternatively check a nightly snapshot build from http://downloads.mysql.com/snapshots.php#connector-j