Skip to the content
Krizaka Java
Skip to Content
Krizaka Java

Persistence

krizaka-persistence — the tables of the kit's JDBC stores created and migrated at startup, in their own Flyway history.

<dependency>
  <groupId>com.krizaka</groupId>
  <artifactId>krizaka-spring-boot-starter-persistence</artifactId>
</dependency>

Declare the stores; their tables exist once the context has started — no initdb script, no DDL copied into your migrations.

You declareTableVersion
krizaka.messaging.outbox.jdbc.enabled: truekrizaka_outbox1.1
krizaka.messaging.dedup.store: jdbcprocessed_messages1.2
krizaka-app-config, store jdbcapp_config, app_config_history2.1
krizaka.idempotency.store: jdbcidempotency_keys3.1

How it migrates

  • Flyway runs the schema each module ships — the same file the module documents, never a copy.
  • In its own history table, krizaka_schema_history: the kit's versions never meet your db/migration.
  • Only the stores you declared; one you add later is migrated out of order, at its own version.
  • Tables an operator already created from the shipped schemas are adopted: the schemas are IF NOT EXISTS, the history is baselined, a missing index is added.
  • A table property (krizaka.messaging.outbox.jdbc.table…) renames the table and its indexes. Renaming it after it was created fails Flyway's validation instead of quietly creating a second table.

krizaka.persistence.migrations.enabled: false leaves the tables to an operator, who runs the shipped schemas.

Pool defaults

At the lowest priority — your application.yml wins:

PropertyDefaultWhy
spring.datasource.hikari.leak-detection-threshold20000a connection held 20 s is logged with the stack that took it
spring.datasource.hikari.connection-timeout10000waiting for a connection fails in 10 s, not 30

Proven

KrizakaMigrationsIT runs on PostgreSQL: every set, an idempotent rerun, a set added out of order, your own Flyway history left untouched, adoption of tables created by hand, a rename refused after creation.

Configuration

PropertyDescription
krizaka.persistence.migrations.enabledBooleandefault trueWhether the tables of the declared JDBC stores are created and migrated at startup. Turn it off when an operator runs the shipped schemas.
krizaka.persistence.migrations.history-tableStringdefault krizaka_schema_historyFlyway history table of the kit's migrations, kept apart from the service's own so their versions never meet.

On this page