diff --git a/doc/release-notes/12241-simple db connector.md b/doc/release-notes/12241-simple db connector.md new file mode 100644 index 00000000000..daa3cc57cb9 --- /dev/null +++ b/doc/release-notes/12241-simple db connector.md @@ -0,0 +1 @@ +This version of Dataverse changes the class used for connecting with Postgres. This should help avoid problems seen under high load and potentially improve performance. See #12241 for details. \ No newline at end of file diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index e5ed52acb83..9d47aa71aaf 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -949,6 +949,9 @@ Connection Validation * - dataverse.db.validate-atmost-once-period-in-seconds - Specifies the time interval in seconds between successive requests to validate a connection at most once. - ``0`` (disabled) + * - dataverse.db.fail-all-connections + - When true, refreshes all connections when one fails, speeding recover vs. detecting and refreshing connections individually. + - ``true`` (enabled) Connection & Statement Leaks ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java index 62cd318706f..5816d8edd91 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/DataSourceProducer.java @@ -12,10 +12,8 @@ name = "java:app/jdbc/dataverse", // The app server (Payara) deploys a managed pool for this data source for us. // We don't need to deal with this on our own. - // - // HINT: PGSimpleDataSource would work too, but as we use a connection pool, go with a javax.sql.ConnectionPoolDataSource - // HINT: PGXADataSource is unnecessary (no distributed transactions used) and breaks ingest. - className = "org.postgresql.ds.PGConnectionPoolDataSource", + + className = "org.postgresql.ds.PGSimpleDataSource", // BEWARE: as this resource is created before defaults are read from META-INF/microprofile-config.properties, // defaults must be provided in this Payara-proprietary manner. @@ -48,6 +46,7 @@ "fish.payara.validation-table-name=${MPCONFIG=dataverse.db.validation-table-name:}", "fish.payara.validation-classname=${MPCONFIG=dataverse.db.validation-classname:}", "fish.payara.validate-atmost-once-period-in-seconds=${MPCONFIG=dataverse.db.validate-atmost-once-period-in-seconds:0}", + "fish.payara.fail-all-connections=${MPCONFIG=dataverse.db.fail-all-connections:true}", // LEAK DETECTION "fish.payara.connection-leak-timeout-in-seconds=${MPCONFIG=dataverse.db.connection-leak-timeout-in-seconds:0}", "fish.payara.connection-leak-reclaim=${MPCONFIG=dataverse.db.connection-leak-reclaim:false}", @@ -57,6 +56,7 @@ "fish.payara.statement-timeout-in-seconds=${MPCONFIG=dataverse.db.statement-timeout-in-seconds:-1}", "fish.payara.slow-query-threshold-in-seconds=${MPCONFIG=dataverse.db.slow-query-threshold-in-seconds:-1}", "fish.payara.log-jdbc-calls=${MPCONFIG=dataverse.db.log-jdbc-calls:false}" + }) public class DataSourceProducer {