Data Access Properties

jmix.data.number-id-cache-size

When an instance of entity with Integer or Long identifier annotated with @JmixGeneratedValue is created in memory via Metadata.create() method, an identifier value is assigned to the entity right away. This value is obtained from the Sequence Generation mechanism that fetches the next id from a database sequence. In order to reduce the number of database calls, the sequence’s increment is set by default to 100, which means that the framework obtains the range of ids on each invocation. So it "caches" this range and yields the ids without going for the next value to the database until the whole range is used.

The property defines the sequence’s increment and the corresponding size of the cached range in memory.

If you change the value of this property when there are already some entities in the database, recreate also all existing sequences with the new increment (which must be equal to jmix.data.number-id-cache-size) and the starting values corresponding to the maximum values of existing ids.

Default value: 100

jmix.data.unique-constraint-violation-pattern

A regular expression which is used by the mechanism of handling unique constraint violations to find out that the exception is caused by a database unique constraint violation. The constraint name will be obtained from the first non-empty group of the expression. For example:

jmix.data.unique-constraint-violation-pattern = ERROR: duplicate key value violates unique constraint "(.+)"

This property allows you to recognize unique constraint violation errors for any DBMS version and locale.

jmix.data.use-entity-data-store-for-id-sequence

If the property is set to true, sequences for generating entity identifiers of Integer or Long type annotated with @JmixGeneratedValue are created in the data store the entity belongs to. Otherwise, they are created in the main data store.

Default value: false

jmix.data.use-read-only-transaction-for-load

Indicates that all loading methods of DataManager use read-only transactions.

Default value: true