[CONJ-90] ResultSet not closed on new execution of Statement Created: 2014-04-08 Updated: 2014-09-10 Resolved: 2014-09-10 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | None |
| Affects Version/s: | 1.1.7 |
| Fix Version/s: | 1.1.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Erik Mattheis | Assignee: | Massimo Siani (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I noticed with Hibernate I sometimes get java.sql.SQLException: There is an open result set on the current connection, which must be closed prior to executing a query when retrieving a result, depending on the complexity of the entity I am loading. Apparently Hibernate is relying on the specified behavior of the Statement to implicitly close any open ResultSet when performing a new execution. From JDBC Spec - 15.2.5 Closing a ResultSet Object ...
I worked around this in a local branch with the following code:
|
| Comments |
| Comment by Massimo Siani (Inactive) [ 2014-07-07 ] | |||||||||||||||||||||||||||||||||||||
|
Test case in rev 514 | |||||||||||||||||||||||||||||||||||||
| Comment by Lennart Schedin [ 2014-09-10 ] | |||||||||||||||||||||||||||||||||||||
|
I looked at the test case in http://bazaar.launchpad.net/~maria-captains/mariadb-java-client/trunk/revision/514. Although it tests the closing I cannot get the test case to fail. I feel that it may be better to have a test case that fails before a bug fix and passes after because it is a higher probability that the test case actually tests the bug fix. I made an attempt to write a test case that failed, but I was unsuccessful. I not that used with Bazaar so I cannot find the fix in the source code. Could I get a link? | |||||||||||||||||||||||||||||||||||||
| Comment by Lennart Schedin [ 2014-09-10 ] | |||||||||||||||||||||||||||||||||||||
|
I have taken the liberty to write a better test case that shows the error. Feel free to add to the source code.
| |||||||||||||||||||||||||||||||||||||
| Comment by Massimo Siani (Inactive) [ 2014-09-10 ] | |||||||||||||||||||||||||||||||||||||
|
Thanks. Setting the row fetch size was necessary to reproduce the bug. |