Skip to content
New issue

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

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

Already on GitHub? # to your account

[JDBC Smart Driver] Executing a prepared statement creates prepared statement after 5 executions #9700

Closed
fritshoogland-yugabyte opened this issue Aug 12, 2021 · 0 comments
Assignees
Labels
area/ecosystem Label for all ecosystem related projects kind/bug This issue is a bug priority/medium Medium priority issue

Comments

@fritshoogland-yugabyte
Copy link

fritshoogland-yugabyte commented Aug 12, 2021

Jira Link: DB-1337
When a statement explicitly created as preparedStatement is executed, it will be executed as non-prepared statement for 5 times. After the fifth time, JDBC will create a server-side prepared statement. This behavior is controlled by the property prepareThreshold, which is set to 5 by default.

This is illogical behavior, if a statement is declared as prepared statement, it should result in a server-side prepared statement as well. Therefore my suggestion is to change the default threshold value to 1, so a server-side prepared statement is created together with the client-side prepared statement object.

By changing the default the behavior becomes more logical, and more efficient because when the java programmer intended to prepare a statement and bind and execute it multiple times, it will actually do that server side too. And the old behavior if needed can always be changed back by explicitly setting it.

@fritshoogland-yugabyte fritshoogland-yugabyte added the area/ecosystem Label for all ecosystem related projects label Aug 12, 2021
@tedyu tedyu self-assigned this Aug 12, 2021
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 8, 2022
@yugabyte-ci yugabyte-ci closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/ecosystem Label for all ecosystem related projects kind/bug This issue is a bug priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

4 participants