You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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: