[CONJ-424] JDBC connector 1.5.6+: preparedStatement + getGeneratedKeys() = faulty exception on _first_ resultset.next() Created: 2017-02-03 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: | Daniel Nilsson | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | jdbc | ||
| Description |
|
{{ connection = dataSource.getConnection(); ResultSet rs = statement.getGeneratedKeys(); rs.next() now throws java.sql.SQLException: Operation not permit on a closed resultSet. This should not happen on first call to rs.next(). Bug introduced in 1.5.7, 1.5.6 behaves as it should with regards to this. |
| Comments |
| Comment by Diego Dupin [ 2017-02-06 ] | ||||||||||||||||||||||||
|
could you post full stracktrace ? I fail to reproduced these issue (try with this works well
| ||||||||||||||||||||||||
| Comment by Daniel Nilsson [ 2017-02-06 ] | ||||||||||||||||||||||||
|
Hi Diego, we're working on providing a good way to reproduce. I also edited the description of this issue - seems like the problem arrived with 1.5.6, not 1.5.7. 1.5.5 works as expected. The exception is thrown by the first line of MariaSelectResultSet next() method. | ||||||||||||||||||||||||
| Comment by Daniel Nilsson [ 2017-02-06 ] | ||||||||||||||||||||||||
|
I might add - we have an internal test that does reproduce this issue, just have to slim it down to something suitable for your GeneratedKeysTest.java. | ||||||||||||||||||||||||
| Comment by Lennart Schedin [ 2017-02-06 ] | ||||||||||||||||||||||||
|
Use this code to reproduce the problem (in the GeneratedKeysTest.java test class context):
| ||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-02-08 ] | ||||||||||||||||||||||||
|
correction in done in 1.5.8-SNAPSHOT, available using :
could you confirm it solve this issue ? | ||||||||||||||||||||||||
| Comment by Daniel Nilsson [ 2017-02-09 ] | ||||||||||||||||||||||||
|
Thanks Diego! I've been busy trying to write a workaround here for another issue that we face - apparently you now by default enable STRICT_TRANS_TABLES with gives us some grief. A ticket is coming on that aswell I have to try and finish a workaround for that before I get to testing your fix. Not sure if I can manage before the weekend, sorry. | ||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-02-09 ] | ||||||||||||||||||||||||
|
danielnilssonse, JDBC required that when a data truncation occur an exception is thrown. So that's the default implementation, but can be disabled using jdbcCompliantTruncation=false in connection string. see more in docs |