From 59898d82a1ff3d5de607240985be02c3ed8df7a4 Mon Sep 17 00:00:00 2001 From: "A.Fink" Date: Mon, 27 May 2024 21:34:16 +0300 Subject: [PATCH] 1.8.3 fix access to autoCommitOverrideEbeanConfig --- gradle.properties | 2 +- .../hibean/HikariEbeanConnectionPoolFactory.java | 9 +++++++++ .../magicprinc/hibean/HikariEbeanDataSourcePool.java | 6 +----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 122c7c8..2267dbb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group = com.github.magicprinc -version = 1.8.2 +version = 1.8.3 org.gradle.jvmargs = -Dfile.encoding=UTF-8 -XX:+UseParallelGC -Xms512m -Xmx1024m -Djava.net.preferIPv4Stack=true systemProp.file.encoding = UTF-8 diff --git a/src/main/java/com/github/magicprinc/hibean/HikariEbeanConnectionPoolFactory.java b/src/main/java/com/github/magicprinc/hibean/HikariEbeanConnectionPoolFactory.java index b8fe072..b3f6306 100644 --- a/src/main/java/com/github/magicprinc/hibean/HikariEbeanConnectionPoolFactory.java +++ b/src/main/java/com/github/magicprinc/hibean/HikariEbeanConnectionPoolFactory.java @@ -3,6 +3,8 @@ import io.ebean.datasource.DataSourceConfig; import io.ebean.datasource.DataSourceFactory; import io.ebean.datasource.DataSourcePool; +import lombok.Getter; +import lombok.Setter; /** HikariCP backed DataSourceFactory. @@ -13,6 +15,13 @@ */ public class HikariEbeanConnectionPoolFactory implements DataSourceFactory { + /** + By default, Ebean pool autoCommit == false. + It can be overridden in config or globally here (if not null). + */ + @Getter @Setter + static Boolean autoCommitOverrideEbeanConfig = null; + @Override public DataSourcePool createPool (String name, DataSourceConfig config) { return new HikariEbeanDataSourcePool(name, config, SmartConfig.asProperties()); diff --git a/src/main/java/com/github/magicprinc/hibean/HikariEbeanDataSourcePool.java b/src/main/java/com/github/magicprinc/hibean/HikariEbeanDataSourcePool.java index 33c10ed..e086e5c 100644 --- a/src/main/java/com/github/magicprinc/hibean/HikariEbeanDataSourcePool.java +++ b/src/main/java/com/github/magicprinc/hibean/HikariEbeanDataSourcePool.java @@ -23,6 +23,7 @@ import java.util.function.IntConsumer; import java.util.function.LongConsumer; +import static com.github.magicprinc.hibean.HikariEbeanConnectionPoolFactory.autoCommitOverrideEbeanConfig; import static com.github.magicprinc.hibean.SmartConfig.alias; import static com.github.magicprinc.hibean.SmartConfig.normValue; import static com.github.magicprinc.hibean.SmartConfig.trim; @@ -55,11 +56,6 @@ */ @Slf4j class HikariEbeanDataSourcePool extends HikariEbeanDataSourceWrapper { - /** - By default, Ebean pool autoCommit == false. - It can be overridden in config or globally here (if not null). - */ - public static Boolean autoCommitOverrideEbeanConfig = null; public HikariEbeanDataSourcePool (String callerPoolName, DataSourceConfig config, Map avajeConfig) { val cfg = SmartConfig.of(avajeConfig);// System.properties overwrite file.properties