Iam facing issue while connecting to 2 postgres DB using JTA.
If I execute queries for each db separately everything looks good,but when I execute both at the same time getting the below error ,I have already set max_prepared_transactions to 100 in postgres.conf
Caused by: org.postgresql.util.PSQLException: ERROR: prepared transactions are disabled Hint: Set max_prepared_transactions to a nonzero value.
The problem is that you have prepared transactions disabled in the
postgresql.conffile. This capability is disabled by default, which makes that the default configuration ismax_prepared_transactions = 0, so, if you are using Atomikos to enable 2PC protocol for your transactions, you must modify this variable in thepostgresql.conf.Example:
Now, this is called a static config for Postgres, which means that in order to work it needs to be configured either at server creation or restart the server after setting this value.
I hope this helps.
More info related to this config here: https://postgresqlco.nf/doc/en/param/max_prepared_transactions/