hungphan227 commented on code in PR #2190: URL: https://github.com/apache/james-project/pull/2190#discussion_r1587172583
########## server/container/guice/postgres-common/src/main/java/org/apache/james/modules/data/PostgresCommonModule.java: ########## @@ -91,9 +88,15 @@ JamesPostgresConnectionFactory provideJamesPostgresConnectionFactory(PostgresCon @Named(JamesPostgresConnectionFactory.NON_RLS_INJECT) @Singleton JamesPostgresConnectionFactory provideJamesPostgresConnectionFactoryWithRLSBypass(PostgresConfiguration postgresConfiguration, + JamesPostgresConnectionFactory jamesPostgresConnectionFactory, @Named(JamesPostgresConnectionFactory.NON_RLS_INJECT) ConnectionFactory connectionFactory) { - LOGGER.info("Implementation for PostgresSQL connection factory: {}", SinglePostgresConnectionFactory.class.getName()); - return new SinglePostgresConnectionFactory(Mono.from(connectionFactory.create()).block()); + if (!postgresConfiguration.rowLevelSecurityEnabled()) { + return jamesPostgresConnectionFactory; + } + return new PoolBackedPostgresConnectionFactory(DISABLED_ROW_LEVEL_SECURITY, + postgresConfiguration.nonRLSPoolInitialSize(), + postgresConfiguration.nonRLSPoolMaxSize(), + connectionFactory); Review Comment: when we use rls-bypass crendentials, there is no need to set domain for connection (the first para of PoolBackedPostgresConnectionFactory constructor is used to check whether setting domain is needed) -- 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-unsubscr...@james.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org