-
Notifications
You must be signed in to change notification settings - Fork 48
Dynamically create databases for multiple BPA instances #60
Comments
Switching to another container-internal in-memory (H2) database is not possible because JSONB datatype is only supported in postgres. |
Yes we specifically use porstgres. Supporting multiple databases would require changing the stack to something like liquibase and hibernate. Back to original issue, creating databases on the fly is not possible with flyway. The workaround is sharing the same database by using schemas meaning each table has a separate namespace. This can be achieved by exposing a new property. Thats the easy part, the hard part is that our init scripts have the public schema in it, which means we have to reset everything. |
I think docker compose might no be the right tool to handle launching of a larger infrastructure with e.g. several agents being launched. what about switching to a cloud native approach? |
Why would you see this more like a workaround , @etschelp ? |
renamed ambiguous tables (schema, user), removed public prefix from create table commands, moved later migrations into the first one, introduced schema property Signed-off-by: Philipp Etschel <philipp@etschel.net>
See pull request. Once merged different agents can share the same database by setting -Doagent.pg.schema=second-agent, default is public. Schemas are separated from each other and can support different agent versions. |
@etschelp Thanks for the quick reaction! Unfortunately, I can't get it working. I deleted all postgres volumes I could find and added the option On the first start, I get the following error:
|
added missing property Signed-off-by: Philipp Etschel <philipp@etschel.net>
Please pull and try again, there was another property missing. |
Issue resolved. Thank you!
|
At the moment only 1 business partner agent (BPA) can run on the posgres instance started with the docker-compose config. If one want to add a second BPA, the same data is loaded into the second BPA. If one tries to change the jdbc connect string to add another database name
..., BPA fails to start with:
BPA should be able to dynamically create the necessary database.
The text was updated successfully, but these errors were encountered: