You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by zm...@apache.org on 2016/02/01 23:00:01 UTC
aurora git commit: Enable ping query to prevent use of invalid pooled
connections.
Repository: aurora
Updated Branches:
refs/heads/master de0029bb6 -> 6c539fe5a
Enable ping query to prevent use of invalid pooled connections.
Bugs closed: AURORA-1596
Reviewed at https://reviews.apache.org/r/42979/
Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/6c539fe5
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/6c539fe5
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/6c539fe5
Branch: refs/heads/master
Commit: 6c539fe5ae47f7504691cb9469cacef9af88c2b0
Parents: de0029b
Author: Zameer Manji <zm...@apache.org>
Authored: Mon Feb 1 13:59:46 2016 -0800
Committer: Zameer Manji <zm...@apache.org>
Committed: Mon Feb 1 13:59:46 2016 -0800
----------------------------------------------------------------------
.../java/org/apache/aurora/scheduler/storage/db/DbModule.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/aurora/blob/6c539fe5/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java b/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
index 8b8c54a..a0344f7 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
@@ -225,6 +225,11 @@ public final class DbModule extends PrivateModule {
bind(new TypeLiteral<Amount<Long, Time>>() { }).toInstance(SLOW_QUERY_LOG_THRESHOLD.get());
+ // Enable a ping query which will prevent the use of invalid connections in the
+ // connection pool.
+ bindProperties(binder(), ImmutableMap.of("mybatis.pooled.pingEnabled", "true"));
+ bindProperties(binder(), ImmutableMap.of("mybatis.pooled.pingQuery", "SELECT 1;"));
+
// Exposed for unit tests.
bind(TaskConfigManager.class);
expose(TaskConfigManager.class);