FirebirdSQL / jaybird

JDBC driver for Firebird
https://firebirdsql.org/en/jdbc-driver/
GNU Lesser General Public License v2.1
94 stars 23 forks source link

Investigate difference between FBStatement and FBPreparedStatement internalExecute #681

Closed mrotteveel closed 2 years ago

mrotteveel commented 3 years ago

The method AbstractFBPreparedStatement.internalExecute(boolean) will reset currentStatementResult to StatementResult.NO_MORE_RESULTS, while FBStatement.internalExecute(String) doesn't. The behaviour of FBPreparedStatement seems to be the right behaviour to me, but TestFBStatement.verifySingletonStatementWithException() explicitly tests for this behaviour.

Investigate the difference, and - if possible - ensure both behave the same.

mrotteveel commented 2 years ago

Conclusion stands, changed to set currentStatementResult to StatementResult.NO_MORE_RESULTS also for FBStatement (and FBCallableStatement) code paths. This means after an exception, retrieval of update counts (with Statement.getUpdateCounts()) will return -1 for all Statement implementations, not just FBPreparedStatement.