jaybird
jaybird copied to clipboard
For FBStatement, unprepare statement after statement completion [JDBC637]
Submitted by: @mrotteveel
Internally, FBStatement also prepares the statement, and keeps it prepared until the next statement is executed. It would probably be a good idea to automatically unprepare (free with DSQL_unprepare) the statement on statement completion to prevent retention of existence locks.
Commits: FirebirdSQL/jaybird@517b0550a01454ebc6d9887f7dd7e9cf99893311
Modified by: @mrotteveel
Fix Version: Jaybird 4.0.3 [ 10981 ]
Fix Version: Jaybird 3.0.11 [ 10980 ]
Fix Version: Jaybird 5 [ 10871 ]
Commented by: @mrotteveel
Note that DSQL_unprepare was introduced in Firebird 2.5, so maybe calling free(DSQL_unprepare) on 2.1 and earlier should either be a no-op or do free(DSQL_close) instead.
Commented by: @mrotteveel
There are some problems with doing this: getUpdateCounts can only be called after statement completion, and same goes for getLastExecutionPlan() and getLastExplainedExecutionPlan(). We could request those at statement completion, but if we do that, we should ask all of this in a single info request to avoid three extra roundtrips, or it might make more sense to (always) request the execution plans as part of prepare.
Commented by: @mrotteveel
Given this is more complicated than I first assumed, only implement this for Jaybird 5 (if there are no more hurdles)
Modified by: @mrotteveel
Fix Version: Jaybird 4.0.3 [ 10981 ] =>
Fix Version: Jaybird 3.0.11 [ 10980 ] =>
Commented by: @mrotteveel
I committed an unprepare method for FbStatement and implementations, but this is not called from JDBC yet.
The complications with the lifetime requirements has made may decide not to implement this.