Bug #71966 | Mysql connector/j prepared statement second close cаuses trouble. | ||
---|---|---|---|
Submitted: | 7 Mar 2014 10:18 | Modified: | 22 Apr 2014 11:36 |
Reporter: | Denis Pimenov | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | 5.1.18/5.1.29 | OS: | Linux |
Assigned to: | CPU Architecture: | Any |
[7 Mar 2014 10:18]
Denis Pimenov
[7 Mar 2014 10:44]
Denis Pimenov
Sorry I forgot to tell about flags useCursorFetch and cachePrepStmts. Minimum url sample: String url = "jdbc:mysql://192.168.184.245/bgbilling_test?cachePrepStmts=true&useCursorFetch=true"; Bug is reproduced with those flags only.
[7 Mar 2014 10:56]
Denis Pimenov
From java.sql.Statement javadoc : "Calling the method close on a Statement object that is already closed has no effect." Connector/J has wrong implementation.
[7 Mar 2014 11:19]
Denis Pimenov
The code above is only synthetic test to reproduce. In real life application gets connection from dbcp pool and same query may be executed on the same connection throm pool and if close method was executed twice(by mistake), then bug reproduces. We have found this bug on our application. We have some double closes in our code and it is difficult to find them all.
[7 Mar 2014 11:34]
Denis Pimenov
Changed version to 5.1.18/5.1.29. It reproduces on both. OS linux(but a think it doesn't depends on OS).
[7 Mar 2014 17:07]
Filipe Silva
Hi Denis, Thank you for this bug report. This issue is related to Bug#67318 and should be fixed in the same patch. Please follow Bug#67318 report progress for further details.
[18 Mar 2014 10:04]
Denis Pimenov
Ok. But these bugs are different. Here ResulySet.close, where - PreparedStatement.close. Here - exception was thrown in prepareStatemen method, where -exception was silently discarded in ResulySet.close method. I'll wait for Connector/J 5.1.30 to check.
[18 Mar 2014 10:33]
Denis Pimenov
Sorry. Vice versa : "Here - PreparedStatement.close, where - ResulySet.close".
[22 Apr 2014 11:36]
Denis Pimenov
I have tested 5.1.30. It's working. Thank you.