[CONJ-443] NullpointerException when making concurrent procedure calls Created: 2017-03-09 Updated: 2017-03-30 Resolved: 2017-03-30 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.5.8 |
| Fix Version/s: | 2.0.0-RC, 1.6.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jonathan Stringer | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
I am making the same call to a store procedure multiple times with very little change in the arguments. The first call succeeds but the second call creates a null pointer exception. The problem is caused at line 487 of MariaDbConnection class. That is when the callableStatementCache is adding a new callableStatement. That callableStatement has a the sql field populated but the value for the items that is added to the callableStatementCache has null sql field. When that value is fetched on line 479 the clone fails with a NullPointerException because the sql field cannot be null. Below is the stack trace. |
| Comments |
| Comment by Jochen Bedersdorfer [ 2017-03-15 ] | |
|
The only NPE that can be thrown here is if `protocol` is null.
| |
| Comment by Jochen Bedersdorfer [ 2017-03-16 ] | |
|
See screenshot. Breakpoint triggered on protocol == null. | |
| Comment by Jochen Bedersdorfer [ 2017-03-16 ] | |
|
Work-around: disable callable prep stmt cache. Add this to your JDBC-URL: |