Details
- 
    Bug 
- 
    Status: Closed (View Workflow)
- 
    Major 
- 
    Resolution: Fixed
- 
    3.4.1
- 
    None
Description
Without any configuration change prepared_stmt_count sharply increases when upgrading from 2.7.5 to 3.4.1, with performance impact.
Additionally while `cachePrepStmts` is marked as removed in 3.0.0:
https://mariadb.com/docs/connectors/mariadb-connector-j/about-mariadb-connector-j#removed-options
The variable not only is still used internally but it seems that its user setting still affects behaviour, so not totally driven by internal behaviour.
In 3.x code:
Confirmation it's internally used:
| // src/main/java/org/mariadb/jdbc/Configuration.java | 
| public class Configuration { | 
| // ... | 
| // prepare | 
| private boolean cachePrepStmts = true; | 
| private int prepStmtCacheSize = 250; | 
| private boolean useServerPrepStmts = false; | 
| // ... | 
| }
 | 
I might be mistaken but I don't see anywhere the variable is excluded from being read, this contradicts the documentation:
Options being read from config:
| Properties propDesc = new Properties(); | 
| try (InputStream inputStream = | 
| Driver.class.getClassLoader().getResourceAsStream("driver.properties")) { | 
|       propDesc.load(inputStream); | 
| } catch (IOException io) { | 
| // eat | 
|     }
 | 
All values assigned to the array:
| List<DriverPropertyInfo> props = new ArrayList<>(); | 
| for (Field field : Configuration.Builder.class.getDeclaredFields()) { | 
| if (!field.getName().startsWith("_")) { | 
| try { | 
| //... | 
| DriverPropertyInfo propertyInfo = new DriverPropertyInfo(field.getName(), value); | 
| //... | 
|   | 
| return props.toArray(new DriverPropertyInfo[0]); | 
|   }
 | 
Set to true if not provided:
| private void initializeAdditionalConfig(Builder builder) { | 
| //... | 
| this.cachePrepStmts = builder.cachePrepStmts == null || builder.cachePrepStmts; | 
| //... | 
Attachments
Issue Links
- relates to
- 
                    CONJ-1238 rewriteBatchStatements required for backwards-compatibility -         
- Closed
 
-         

