[CONJ-120] Connection.isValid(int) does not work when connection is closed Created: 2014-10-30 Updated: 2014-11-26 Resolved: 2014-11-26 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | None |
| Affects Version/s: | 1.1.7 |
| Fix Version/s: | 1.1.8 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Lennart Schedin | Assignee: | Massimo Siani (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Background: How to reproduce:
Psedo-code:
Actual MariaDB JDBC: Actual Mysql JDBC: Actual H2: Expected: However every JDBC implementation has ignored that a negative timeout should throw an SQLException. This is probably such a minor detail that it is not worth fixing. |
| Comments |
| Comment by Massimo Siani (Inactive) [ 2014-10-30 ] | ||||||||
|
New branch https://code.launchpad.net/~massimo-siani/mariadb-java-client/CONJ-120 | ||||||||
| Comment by Lennart Schedin [ 2014-11-04 ] | ||||||||
|
I checked the code in the branch briefly and I think that could work. However I'm not sure what kind of Exception that should trigger the isValid() method to throw an exception? Should it ever throw an Exception (except the negative time)? | ||||||||
| Comment by Massimo Siani (Inactive) [ 2014-11-04 ] | ||||||||
|
isValid only throws a SQLException when the provided timeout is negative. It has to return false in the case the connection has been closed, doesn't it? | ||||||||
| Comment by Lennart Schedin [ 2014-11-04 ] | ||||||||
|
You might be correct. I was unsure in what situations the code might reach the row with SQLExceptionMapper.throwException(e, this, null) and throw an exception. Should the call to SQLExceptionMapper.throwException() even be there?
|