You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "woj-tek (via GitHub)" <gi...@apache.org> on 2023/06/06 00:57:25 UTC

[GitHub] [james-project] woj-tek opened a new pull request, #1580: Allow passing openjpa and underlying datasource (DBCP2) properties

woj-tek opened a new pull request, #1580:
URL: https://github.com/apache/james-project/pull/1580

   This is a little bit of POC referencing my last mail in thread "OpenJPA pool with DBCP".
   
   It fixes:
   * configuring `openjpa.Multithreaded` (with defaulting to `true` unless configured otherwise)
   * configuring additional openjpa properties: originally it used ` openjpa.ConnectionFactoryProperties` but as configuration (https://openjpa.apache.org/builds/3.2.2/apache-openjpa/docs/index.html#ref_guide_dbsetup_config) indicates it's only for internal DataSource (and `MaxTotal` would not even be considered here) - used `openjpa.ConnectionProperties` instead
   
   Added passing all `openjpa.*` and `datasource.*` properties from `james-database.properties` file to openjpa or to DBCP2 (via `openjpa.ConnectionProperties`) respectively. I left existing `connectionProperties` (`TestOnBorrow`, `ValidationTimeout`, `ValidationSQL` and `MaxTotal`) though they could probably be removed altogether at this point.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] Arsnael merged pull request #1580: Allow passing openjpa and underlying datasource (DBCP2) properties

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael merged PR #1580:
URL: https://github.com/apache/james-project/pull/1580


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] woj-tek commented on pull request #1580: Allow passing openjpa and underlying datasource (DBCP2) properties

Posted by "woj-tek (via GitHub)" <gi...@apache.org>.
woj-tek commented on PR #1580:
URL: https://github.com/apache/james-project/pull/1580#issuecomment-1579064629

   > Should be documented:
   
   I didn't add documentation earlier as I wasn't sure if the change is good/desired. I just pushed updated documentation and corrected formatting.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org


[GitHub] [james-project] chibenwa commented on a diff in pull request #1580: Allow passing openjpa and underlying datasource (DBCP2) properties

Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #1580:
URL: https://github.com/apache/james-project/pull/1580#discussion_r1218765616


##########
server/container/guice/jpa-common/src/main/java/org/apache/james/modules/data/JPAEntityManagerModule.java:
##########
@@ -68,15 +76,34 @@ public EntityManagerFactory provideEntityManagerFactory(JPAConfiguration jpaConf
     @Singleton
     JPAConfiguration provideConfiguration(PropertiesProvider propertiesProvider) throws FileNotFoundException, ConfigurationException {
         Configuration dataSource = propertiesProvider.getConfiguration("james-database");
+
+        Map<String, String> openjpaProperties = getKeysForPrefix(dataSource, "openjpa", false);
+        Map<String, String> datasourceProperties = getKeysForPrefix(dataSource, "datasource", true);
+
+
         return JPAConfiguration.builder()
                 .driverName(dataSource.getString("database.driverClassName"))
                 .driverURL(dataSource.getString("database.url"))
                 .testOnBorrow(dataSource.getBoolean("datasource.testOnBorrow", false))
                 .validationQueryTimeoutSec(dataSource.getInteger("datasource.validationQueryTimeoutSec", null))
                 .validationQuery(dataSource.getString("datasource.validationQuery", null))
                 .maxConnections(dataSource.getInteger("datasource.maxTotal",null))
+                .multithreaded(dataSource.getBoolean(JPAConfiguration.JPA_MULTITHREADED,true))

Review Comment:
   ```suggestion
                   .multithreaded(dataSource.getBoolean(JPAConfiguration.JPA_MULTITHREADED, true))
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org