We’re using a Payara 5 server with 4 application instances. A JDBC pool is configured with 5 set as the maximum number of connections in the pool. A JDBC resource pointing at the JDBC connection pool is also created and the cluster is set as the target.
I would have expected that all 4 instances can only use at most 5 connections in total. However, in our database tool I can see that each instance can make 5 connections, so the total number of connections is 20. With the given setup, I thought the pool is shared between all instances, but it’s not.
The JNDI name is used in the persistence.xml as the value for the <jta-data-source>
element.
Why is the pool not shared among all instances?
If anyone has a pointer to the documentation which could clarify this, this would really help.
I don’t have a pointer to the documentation but it’s true that connection pools are not synchronized among instances. Each instance has its own connection pool with the same configuration. If max connections is 5 and you have 4 instances, then total number of connections would be 20.
2