Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For FBStatement, unprepare statement after statement completion [JDBC637] #667

Open
firebird-issue-importer opened this issue Mar 6, 2021 · 6 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Mar 6, 2021

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: 517b055

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 6, 2021

Modified by: @mrotteveel

Fix Version: Jaybird 4.0.3 [ 10981 ]

Fix Version: Jaybird 3.0.11 [ 10980 ]

Fix Version: Jaybird 5 [ 10871 ]

Loading

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 6, 2021

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.

Loading

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 11, 2021

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.

Loading

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 11, 2021

Commented by: @mrotteveel

Given this is more complicated than I first assumed, only implement this for Jaybird 5 (if there are no more hurdles)

Loading

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 11, 2021

Modified by: @mrotteveel

Fix Version: Jaybird 4.0.3 [ 10981 ] =>

Fix Version: Jaybird 3.0.11 [ 10980 ] =>

Loading

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 11, 2021

Commented by: @mrotteveel

I committed an unprepare method for FbStatement and implementations, but this is not called from JDBC yet.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants