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

Double-check and fix completion behaviour of statements in auto-commit #806

Closed mrotteveel closed 4 months ago

mrotteveel commented 6 months ago

While working on #805, I noticed that FBPreparedStatement.execute() does not properly commit the transaction in auto-commit if an exception is thrown. This needs to be fixed, and also verified for other execute and executeXXX methods.

To be clear, it should commit even though it failed. The JDBC specification explicitly says that in auto-commit mode, the transaction should be committed if statement execution finishes, and it doesn't mention anything about rolling back in case of failure. In general, Firebird will undo the effects of a statement that raised an error anyway.

Fix to be backported to v5.