File tree 1 file changed +3
-3
lines changed
service/src/main/java/bio/terra/profile/app/configuration
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 8
8
import org .apache .commons .dbcp2 .PoolingDataSource ;
9
9
import org .apache .commons .lang3 .builder .ToStringBuilder ;
10
10
import org .apache .commons .lang3 .builder .ToStringStyle ;
11
- import org .apache .commons .pool2 .ObjectPool ;
12
11
import org .apache .commons .pool2 .impl .GenericObjectPool ;
13
12
14
13
/** Base class for accessing database connection configuration properties. */
@@ -64,10 +63,11 @@ private void configureDataSource() {
64
63
65
64
PoolableConnectionFactory poolableConnectionFactory =
66
65
new PoolableConnectionFactory (connectionFactory , null );
66
+ poolableConnectionFactory .setValidationQuery ("SELECT 1" );
67
67
68
- ObjectPool <PoolableConnection > connectionPool =
68
+ GenericObjectPool <PoolableConnection > connectionPool =
69
69
new GenericObjectPool <>(poolableConnectionFactory );
70
-
70
+ connectionPool . setTestOnBorrow ( true );
71
71
poolableConnectionFactory .setPool (connectionPool );
72
72
73
73
dataSource = new PoolingDataSource <>(connectionPool );
You can’t perform that action at this time.
0 commit comments