Skip to content

protocol: multi-datasource config pattern for apps using ledger+work+qhorus together #16

@mdproctor

Description

@mdproctor

Rule to formalise

Any casehub application that includes all three foundation extensions (casehub-ledger, casehub-work, casehub-qhorus) must configure two Hibernate persistence units:

PU Datasource Packages
default default datasource io.casehub.work.runtime.model + app domain
qhorus qhorus named datasource io.casehub.qhorus.runtime + io.casehub.ledger.runtime.model + io.casehub.ledger.model

Plus casehub.ledger.datasource=qhorus to route the ledger CDI producer to the qhorus PU.

Why: casehub-work expects @Default EntityManager. casehub-qhorus always runs on a named qhorus datasource (platform convention). casehub-ledger's producer selects by datasource name — when blank, it selects @Default. The only working split puts ledger on the qhorus PU (following claudony's pattern) while leaving work on the default PU.

Reference: discovered while bootstrapping casehub-aml (casehubio/aml#12). Pattern validated from claudony's application.properties.

Requested action

Add a protocol entry to docs/protocols/ covering this config pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions