Hello, I have Tomcat 8.5.23 with following context.xml: <Resource name="jdbc/pgxads" auth="Container" type="org.postgresql.xa.PGXADataSource" factory="org.apache.tomcat.jdbc.naming.GenericNamingResourcesFactory" serverName="db" databaseName="postgres" user="postgres" password="postgres" />
<Resource name="sharedDataSource" auth="Container" type="javax.sql.XADataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" dataSourceJNDI="jdbc/pgxads" timeBetweenEvictionRunsMillis="34000" minEvictableIdleTimeMillis="55000" testOnBorrow="true" testOnCreate="true" validationInterval="34000" validationQuery="select 1" /> It declares XADataSource using Tomcat JDBC CP. When I retrieve a connection I get the following exception: org.postgresql.util.PSQLException: Connection has been closed. If I declare connection without Tomcat CP it works ok: <Resource name="sharedDataSource" auth="Container" type="org.postgresql.xa.PGXADataSource" factory="org.postgresql.xa.PGXADataSourceFactory" serverName="db" databaseName="postgres" user="postgres" password="postgres" /> Do I have any errors in my configuration? I prepared a simple demo app on github for problem demonstration: https://github.com/Speedbird/ds-test To reproduce problem run: "mvn clean package && docker-compose up" Thanks --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org