From 2c410e6b6957c4f862d4f4a45b9ce4f7f6d279dc Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Fri, 14 Jun 2024 23:28:39 +1200 Subject: [PATCH] Default validateOnHeartbeat = !System.getenv().containsKey("LAMBDA_TASK_ROOT"); With this we can then remove the explicit experimental lambdaMode() and just auto detect it. When running in lambda we don't want to validate connections in a background task due to lambda suspend. --- .../src/main/java/io/ebean/datasource/DataSourceConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java b/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java index 326990c..fd50dc0 100644 --- a/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java +++ b/ebean-datasource-api/src/main/java/io/ebean/datasource/DataSourceConfig.java @@ -80,7 +80,7 @@ public class DataSourceConfig implements DataSourceBuilder.Settings { private Properties clientInfo; private String applicationName; private boolean shutdownOnJvmExit; - private boolean validateOnHeartbeat = true; + private boolean validateOnHeartbeat = !System.getenv().containsKey("LAMBDA_TASK_ROOT"); @Override public Settings settings() {