4.5. SQLFactory Properties
Prev | Chapter 4. JDBC | Next

## 4.5. SQLFactory Properties

Some aspects of advanced SQL aren't configured through the `DBDictionary`, but through the `SQLFactory`. The `kodo.jdbc.SQLFactory` configuration property is a plugin string you can use to configure the following parameters:

- `BatchLimit`: The maximum number of SQL update statements to batch together. Set to 0 to disable statement batching, or -1 for no limit. See Section 4.10, “Statement Batching”.

- `BatchParameterLimit`: The maximum number of parameters that can be batched together for a single batch update. Some databases can only handle a certain total number of prepared statement parameters in a single batch. This value will cause Kodo to flush a SQL batch once the number of batched statements times the number of bound parameters per statement exceeds this value. Set to 0 to disable SQL batching, or -1 for no limit.

- `SupportsUpdateCountsForBatch`: Whether the JDBC driver correctly returns the set of update counts when a batch statement is executed.

- `SupportsTotalCountsForBatch`: If a JDBC driver doesn't support batch update counts, whether it at least returns the total number of updates made when a batch statement is executed.

- `SupportsUnion`: Whether the database supports SQL UNIONs.

- `SupportsUnionWithUnalignedOrdering`: Whether the database supports SQL UNIONs that order on columns that are not in the same position in all the SELECTs that make up the UNION.

The defaults for these properties depend on the database in use.

Example 4.8. Configuring SQLFactory Properties

JPA XML format:

    <property name="kodo.jdbc.SQLFactory" value="BatchLimit=100, SupportsUnion=true"/>

JDO properties format:

    kodo.jdbc.SQLFactory: BatchLimit=100, SupportsUnion=true

Prev | Up | Next
4.4. Database Support | Home | 4.6. Setting the Transaction Isolation