You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit adds spring.datasource.lazy-connection property into
a DataSourceProperties class to enable a LazyConnectionDataSourceBeanPostProcessor.
BeanPostProcessor wraps an auto-configured DataSource in a LazyConnectionDataSourceProxy.
It will be added only if a spring.datasource.lazy-connection property has true
and a LazyConnectionDataSourceProxy class is present.
The default value of the spring.datasource.lazy-connection property is false,
which means a lazy-connection feature is disabled by default.
closesgh-15480
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration.java
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2018 the original author or authors.
2
+
* Copyright 2012-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -57,7 +57,8 @@ public class DataSourceAutoConfiguration {
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2018 the original author or authors.
2
+
* Copyright 2012-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -149,6 +149,11 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
149
149
*/
150
150
privateCharsetsqlScriptEncoding;
151
151
152
+
/**
153
+
* Whether datasource must be wrapped in a LazyConnectionDataSourceProxy.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfiguration.java
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2018 the original author or authors.
2
+
* Copyright 2012-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java
+78-17Lines changed: 78 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2018 the original author or authors.
2
+
* Copyright 2012-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/XADataSourceAutoConfigurationTests.java
+20-3Lines changed: 20 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2018 the original author or authors.
2
+
* Copyright 2012-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
0 commit comments