[JDBC Smart Driver] Executing a prepared statement creates prepared statement after 5 executions #9700
Labels
area/ecosystem
Label for all ecosystem related projects
kind/bug
This issue is a bug
priority/medium
Medium priority issue
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.
The text was updated successfully, but these errors were encountered: