[CONJ-426] PreparedStatement#executeBatch Does Not Properly Handle Interrupts Created: 2017-02-07  Updated: 2017-02-09  Resolved: 2017-02-09

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.5.7
Fix Version/s: 1.5.8

Type: Bug Priority: Major
Reporter: Kevin Conaway Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

The PreparedStatement#executeBatch() functionality does not properly handle interrupts when the thread is interrupted while waiting on a response from the server.

The InterruptedException is currently being swallowed in AbstractMultiSend instead of being propagated back to the caller.

This manifested as a NullPointerException:

java.lang.NullPointerException: null
	at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeBatch(MariaDbServerPreparedStatement.java:276) ~[mariadb-java-client-1.5.7.jar:na]
...snip...

The NPE is due a race condition. The thread was interrupted so it is returning before the results are available



 Comments   
Comment by Kevin Conaway [ 2017-02-07 ]

Submitted PR: https://github.com/MariaDB/mariadb-connector-j/pull/99

Comment by Diego Dupin [ 2017-02-09 ]

correction (based on kevinconaway PR) is available in 1.5.8-SNAPSHOT, available using :

<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>
 
<dependencies>
    <dependency>
        <groupId>org.mariadb.jdbc</groupId>
        <artifactId>mariadb-java-client</artifactId>
        <version>1.5.8-SNAPSHOT</version>
    </dependency>
</dependencies>

Generated at Thu Feb 08 03:15:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.