"org.apache.ibatis.exceptions.PersistenceException: ",
"### Error querying database. Cause: java.sql.SQLException: Error accessing PooledConnection. Connection is invalid.",
"### The error may exist in com/api/resources/menutype/MenuTypeMapper.java (best guess)",
"### The error may involve com.resources.menutype.MenuTypeMapper.getAll",
"### The error occurred while executing a query",
"### SQL: SELECT * from menu_types where site_id = ?",
"### Cause: java.sql.SQLException: Error accessing PooledConnection. Connection is invalid.",
"\tat org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)",
"\tat org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)",
"\tat org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)",
"\tat org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)",
"\tat org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)",
"\tat org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)",
"\tat com.sun.proxy.$Proxy104.getAll(Unknown Source)",
The specific SQL statement/module varies. It happens against RDS Postgres in AWS, as well as locally (postgres). No firewall in the way. Can reproduce locally and in production with a simple load test. have the pool configured like so (and have tried playing around with different settings:
<dataSource type="POOLED">
<property name="driver" value="${driver}"/>
<property name="url" value="${url}"/>
<property name="username" value="${username}"/>
<property name="password" value="${password}"/>
<property name="poolMaximumActiveConnections" value="50"/> <== have also tried 10, 20,and 30
<property name="poolMaximumIdleConnections" value="20"/> <== have also tried 5, 10
<property name="poolMaximumCheckoutTime" value="5000"/> <== have also tried 20000
</dataSource>