4.9. Statement Batching
Prev | Chapter 4. JDBC | Next

## 4.9. Statement Batching

In addition to connection pooling and prepared statement caching, Kodo employs statement batching to speed up JDBC updates. Statement batching is enabled by default for any JDBC driver that supports it. When batching is on, Kodo automatically orders its SQL statements to maximize the size of each batch. This can result in large performance gains for transactions that modify a lot of data.

| Important
This feature requires Kodo Enterprise Edition or Kodo Standard Edition with the Performance Pack.

You configure statement batching through the system `DBDictionary`, which is controlled by the `kodo.jdbc.DBDictionary` configuration property. The example below shows how to enable and disable statement batching via your configuration properties.

Example 4.13. Configuring SQL Batching

The batch limit is the maximum number of statements Kodo will ever batch together. A value of -1 means "no limit" - this is the default for most dictionaries. A value of 0 disables batching.

JPA XML format:

    <property name="kodo.jdbc.DBDictionary" value="BatchLimit=25"/>

JDO properties format:

    kodo.jdbc.DBDictionary: BatchLimit=25

Prev | Up | Next
4.8. Configuring the Use of JDBC Connections | Home | 4.10. Large Result Sets