Skip to content

Commit

Permalink
Remove experimental lambda mode as it now detects it automatically an…
Browse files Browse the repository at this point in the history
…d otherwise...

Otherwise explicitly set validateOnHeartbeat(false)
  • Loading branch information
rbygrave committed Jun 20, 2024
1 parent f1ff322 commit 2e49639
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,6 @@ default DataSourceBuilder initDatabaseForPlatform(String platform) {
*/
DataSourceBuilder validateOnHeartbeat(boolean validateOnHeartbeat);

/**
* EXPERIMENTAL feature - Set to true when using in Lambda to enable an extra
* check to detect when the function has been restored from suspension.
*/
@Deprecated(since = "Experimental feature")
DataSourceBuilder lambdaMode(boolean useLambda);

/**
* Load the settings from the properties with no prefix on the property names.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,12 +715,6 @@ public DataSourceConfig validateOnHeartbeat(boolean validateOnHeartbeat) {
return this;
}

@Override
public DataSourceBuilder lambdaMode(boolean useLambda) {
this.validateOnHeartbeat = false;
return this;
}

@Override
public DataSourceConfig load(Properties properties) {
return load(properties, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void defaults_someOverride() {
readOnly.setMinConnections(3);
readOnly.setUsername("foo2");
readOnly.setUrl("jdbc:postgresql://127.0.0.2:5432/unit");
readOnly.lambdaMode(true);
readOnly.validateOnHeartbeat(false);

DataSourceBuilder configBuilder = create();
DataSourceConfig readOnly2 = readOnly.setDefaults(configBuilder);
Expand All @@ -145,7 +145,7 @@ public void defaults_someOverride2() {
DataSourceConfig readOnly = new DataSourceConfig();
readOnly.setUrl("jdbc:postgresql://127.0.0.2:5432/unit");

DataSourceBuilder configBuilder = create().shutdownOnJvmExit(true).lambdaMode(true);
DataSourceBuilder configBuilder = create().shutdownOnJvmExit(true).validateOnHeartbeat(false);
DataSourceConfig readOnly2 = readOnly.setDefaults(configBuilder);

assertThat(readOnly2).isSameAs(readOnly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void createPool_forLambda() throws Exception {
.url("jdbc:h2:mem:factory2")
.username("sa")
.password("")
.lambdaMode(true)
.validateOnHeartbeat(false)
// .trimPoolFreqSecs(-1) // stop the heartbeat and reduce LAMBDA_MILLIS to 1100
.build();

Expand Down

0 comments on commit 2e49639

Please sign in to comment.