4.10. 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.

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.14. 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


Skip navigation bar   Back to Top