Repository: usergrid
Updated Branches:
  refs/heads/master b41845188 -> bb5d3f563


Add database connection closing to shutdown listener and again tweak test 
properties.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/bb5d3f56
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/bb5d3f56
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/bb5d3f56

Branch: refs/heads/master
Commit: bb5d3f5634fc7843354b3614c12ff76646d2e15f
Parents: b418451
Author: Michael Russo <[email protected]>
Authored: Sun Nov 13 21:05:11 2016 -0800
Committer: Michael Russo <[email protected]>
Committed: Sun Nov 13 21:05:11 2016 -0800

----------------------------------------------------------------------
 stack/core/src/test/resources/log4j.properties       |  2 ++
 .../test/resources/usergrid-custom-test.properties   |  2 +-
 .../src/test/resources/dynamic-test.properties       |  2 +-
 .../src/test/resources/usergrid-CHOP.properties      |  2 +-
 .../src/test/resources/usergrid-UNIT.properties      |  2 +-
 .../src/test/resources/usergrid.properties           |  2 +-
 .../persistence/core/datastax/DataStaxCluster.java   |  2 ++
 .../core/datastax/impl/DataStaxClusterImpl.java      | 15 +++++++++++++--
 .../src/test/resources/usergrid-UNIT.properties      |  2 +-
 .../graph/src/test/resources/usergrid-AWS.properties |  2 +-
 .../src/test/resources/usergrid-CHOP.properties      |  2 +-
 .../src/test/resources/usergrid-UNIT.properties      |  2 +-
 .../graph/src/test/resources/usergrid.properties     |  2 +-
 .../src/test/resources/dynamic-test.properties       |  2 +-
 .../src/test/resources/usergrid-CHOP.properties      |  2 +-
 .../src/test/resources/usergrid-UNIT.properties      |  2 +-
 .../persistence/qakka/core/CassandraClientImpl.java  |  8 ++++----
 .../qakka/core/QueueMessageManagerTest.java          |  6 ++++++
 .../queue/src/test/resources/log4j.properties        |  7 ++++---
 .../queue/src/test/resources/qakka.properties        |  2 +-
 .../org/apache/usergrid/rest/ShutdownListener.java   |  6 ++++++
 .../test/resources/usergrid-custom-test.properties   |  2 +-
 .../test/resources/usergrid-custom-test.properties   |  2 +-
 23 files changed, 53 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/core/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/log4j.properties 
b/stack/core/src/test/resources/log4j.properties
index 714f2f7..16470e5 100644
--- a/stack/core/src/test/resources/log4j.properties
+++ b/stack/core/src/test/resources/log4j.properties
@@ -68,3 +68,5 @@ 
log4j.logger.org.apache.usergrid.corepersistence.migration=WARN
 log4j.logger.org.apache.usergrid.corepersistence.index.IndexServiceImpl=DEBUG
 
 log4j.logger.org.apache.usergrid.utils.UUIDUtilsTest=DEBUG
+
+log4j.logger.org.safehaus.guicyfig.GuicyFigModule=ERROR

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/core/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/usergrid-custom-test.properties 
b/stack/core/src/test/resources/usergrid-custom-test.properties
index ffc7692..55d881f 100644
--- a/stack/core/src/test/resources/usergrid-custom-test.properties
+++ b/stack/core/src/test/resources/usergrid-custom-test.properties
@@ -14,7 +14,7 @@
 
 # these settings allow tests to run and consistently pass on 16GB MacBook Pro
 # with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml)
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/collection/src/test/resources/dynamic-test.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/collection/src/test/resources/dynamic-test.properties 
b/stack/corepersistence/collection/src/test/resources/dynamic-test.properties
index 5c68a4f..7f5b691 100644
--- 
a/stack/corepersistence/collection/src/test/resources/dynamic-test.properties
+++ 
b/stack/corepersistence/collection/src/test/resources/dynamic-test.properties
@@ -1,6 +1,6 @@
 # The properties are not the actual configuration properties but
 # safe dynamic property defaults for our testing via IDE or Maven
-cassandra.connections=100
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 cassandra.hosts=localhost

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties 
b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
index 212650d..cd130ae 100644
--- 
a/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
+++ 
b/stack/corepersistence/collection/src/test/resources/usergrid-CHOP.properties
@@ -18,7 +18,7 @@
 
 # These are for CHOP environment settings
 
-cassandra.connections=100
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties 
b/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
index 81faabf..4dd2686 100644
--- 
a/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
+++ 
b/stack/corepersistence/collection/src/test/resources/usergrid-UNIT.properties
@@ -18,7 +18,7 @@
 #
 
 # Keep nothing but overriding test defaults in here
-cassandra.connections=100
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 cassandra.hosts=localhost

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/collection/src/test/resources/usergrid.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/collection/src/test/resources/usergrid.properties 
b/stack/corepersistence/collection/src/test/resources/usergrid.properties
index 0fa8f26..67d0899 100644
--- a/stack/corepersistence/collection/src/test/resources/usergrid.properties
+++ b/stack/corepersistence/collection/src/test/resources/usergrid.properties
@@ -31,7 +31,7 @@ usergrid.cluster.seeds=us-east\:localhost
 collection.uniquevalues.actors=300
 collection.uniquevalues.authoritative.region=us-east
 
-cassandra.connections=100
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 
 # --- End: Usergrid cluster/actor system settings

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
 
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
index 5944b36..008e8e1 100644
--- 
a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
+++ 
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/DataStaxCluster.java
@@ -38,4 +38,6 @@ public interface DataStaxCluster {
 
     void waitForSchemaAgreement();
 
+    void shutdown();
+
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
 
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
index de3aa65..e3064a0 100644
--- 
a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
+++ 
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
@@ -216,8 +216,8 @@ public class DataStaxClusterImpl implements DataStaxCluster 
{
 
         // purposely add a couple seconds to the driver's lower level socket 
timeouts vs. cassandra timeouts
         final SocketOptions socketOptions = new SocketOptions()
-            .setConnectTimeoutMillis( cassandraConfig.getTimeout() + 2000)
-            .setReadTimeoutMillis( cassandraConfig.getTimeout() + 2000);
+            .setConnectTimeoutMillis( cassandraConfig.getTimeout())
+            .setReadTimeoutMillis( cassandraConfig.getTimeout());
 
         final QueryOptions queryOptions = new QueryOptions()
             .setConsistencyLevel(defaultConsistencyLevel);
@@ -247,6 +247,17 @@ public class DataStaxClusterImpl implements 
DataStaxCluster {
 
     }
 
+    @Override
+    public void shutdown(){
+
+        logger.info("Received shutdown request, shutting down cluster and 
keyspace sessions NOW!");
+
+        getApplicationSession().close();
+        getApplicationLocalSession().close();
+        getCluster().close();
+
+    }
+
     private ProtocolVersion getProtocolVersion(String versionNumber){
 
         ProtocolVersion protocolVersion;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties 
b/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
index 34d7d48..0a43209 100644
--- a/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
+++ b/stack/corepersistence/common/src/test/resources/usergrid-UNIT.properties
@@ -18,7 +18,7 @@
 #
 
 # Keep nothing but overriding test defaults in here
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 cassandra.hosts=localhost

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/graph/src/test/resources/usergrid-AWS.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/graph/src/test/resources/usergrid-AWS.properties 
b/stack/corepersistence/graph/src/test/resources/usergrid-AWS.properties
index 5fa82b8..4dd17e2 100644
--- a/stack/corepersistence/graph/src/test/resources/usergrid-AWS.properties
+++ b/stack/corepersistence/graph/src/test/resources/usergrid-AWS.properties
@@ -1,5 +1,5 @@
 # Keep nothing but overriding test defaults in here
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 cassandra.hosts=

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties 
b/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties
index 474c2de..ea4c3c7 100644
--- a/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties
+++ b/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties
@@ -1,6 +1,6 @@
 # These are for CHOP environment settings
 
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties 
b/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
index a9a7c40..96834e6 100644
--- a/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
+++ b/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
@@ -1,5 +1,5 @@
 # Keep nothing but overriding test defaults in here
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 cassandra.hosts=localhost

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/graph/src/test/resources/usergrid.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/resources/usergrid.properties 
b/stack/corepersistence/graph/src/test/resources/usergrid.properties
index d67258d..d744efe 100644
--- a/stack/corepersistence/graph/src/test/resources/usergrid.properties
+++ b/stack/corepersistence/graph/src/test/resources/usergrid.properties
@@ -1,5 +1,5 @@
 # This property is required to be set and cannot be defaulted anywhere
 usergrid.cluster_name=usergrid
 
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties 
b/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties
index 8e2d22c..73c0b68 100644
--- 
a/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties
+++ 
b/stack/corepersistence/queryindex/src/test/resources/dynamic-test.properties
@@ -1,6 +1,6 @@
 # The properties are not the actual configuration properties but
 # safe dynamic property defaults for our testing via IDE or Maven
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 cassandra.hosts=localhost

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/queryindex/src/test/resources/usergrid-CHOP.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/queryindex/src/test/resources/usergrid-CHOP.properties 
b/stack/corepersistence/queryindex/src/test/resources/usergrid-CHOP.properties
index e1fb08a..677df96 100644
--- 
a/stack/corepersistence/queryindex/src/test/resources/usergrid-CHOP.properties
+++ 
b/stack/corepersistence/queryindex/src/test/resources/usergrid-CHOP.properties
@@ -1,5 +1,5 @@
 # These are for CHOP environment settings
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 cassandra.port=9160
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/queryindex/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/queryindex/src/test/resources/usergrid-UNIT.properties 
b/stack/corepersistence/queryindex/src/test/resources/usergrid-UNIT.properties
index 628998b..18757a4 100644
--- 
a/stack/corepersistence/queryindex/src/test/resources/usergrid-UNIT.properties
+++ 
b/stack/corepersistence/queryindex/src/test/resources/usergrid-UNIT.properties
@@ -4,7 +4,7 @@ cassandra.embedded=true
 cassandra.hosts=127.0.0.1
 cassandra.port=9160
 cassandra.cluster_name=Usergrid
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 
 collections.keyspace=Usergrid_Collections

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/qakka/core/CassandraClientImpl.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/qakka/core/CassandraClientImpl.java
 
b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/qakka/core/CassandraClientImpl.java
index d1ad442..d647bf2 100644
--- 
a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/qakka/core/CassandraClientImpl.java
+++ 
b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/qakka/core/CassandraClientImpl.java
@@ -44,8 +44,8 @@ public class CassandraClientImpl implements CassandraClient {
 
 
     @Override
-    public Session getApplicationSession() {
-        if ( applicationSession == null ) {
+    public synchronized Session getApplicationSession() {
+        if ( applicationSession == null || applicationSession.isClosed() ) {
             applicationSession = dataStaxCluster.getApplicationSession();
         }
         return applicationSession;
@@ -53,8 +53,8 @@ public class CassandraClientImpl implements CassandraClient {
 
 
     @Override
-    public Session getQueueMessageSession() {
-        if ( queueMessageSession == null ) {
+    public synchronized Session getQueueMessageSession() {
+        if ( queueMessageSession == null || queueMessageSession.isClosed() ) {
             queueMessageSession = dataStaxCluster.getApplicationLocalSession();
         }
         return queueMessageSession;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/queue/src/test/java/org/apache/usergrid/persistence/qakka/core/QueueMessageManagerTest.java
----------------------------------------------------------------------
diff --git 
a/stack/corepersistence/queue/src/test/java/org/apache/usergrid/persistence/qakka/core/QueueMessageManagerTest.java
 
b/stack/corepersistence/queue/src/test/java/org/apache/usergrid/persistence/qakka/core/QueueMessageManagerTest.java
index d944b3d..5bb89c4 100644
--- 
a/stack/corepersistence/queue/src/test/java/org/apache/usergrid/persistence/qakka/core/QueueMessageManagerTest.java
+++ 
b/stack/corepersistence/queue/src/test/java/org/apache/usergrid/persistence/qakka/core/QueueMessageManagerTest.java
@@ -23,9 +23,11 @@ import com.datastax.driver.core.DataType;
 import com.datastax.driver.core.ProtocolVersion;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
+import jnr.ffi.annotations.In;
 import net.jcip.annotations.NotThreadSafe;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.usergrid.persistence.actorsystem.ActorSystemFig;
+import org.apache.usergrid.persistence.core.datastax.DataStaxCluster;
 import org.apache.usergrid.persistence.qakka.AbstractTest;
 import org.apache.usergrid.persistence.qakka.App;
 import org.apache.usergrid.persistence.qakka.QakkaFig;
@@ -45,6 +47,7 @@ import 
org.apache.usergrid.persistence.qakka.serialization.sharding.impl.ShardCo
 import 
org.apache.usergrid.persistence.qakka.serialization.transferlog.TransferLog;
 import 
org.apache.usergrid.persistence.qakka.serialization.transferlog.TransferLogSerialization;
 import org.apache.usergrid.persistence.queue.TestModule;
+import org.junit.After;
 import org.junit.Assert;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -66,6 +69,9 @@ public class QueueMessageManagerTest extends AbstractTest {
         return Guice.createInjector( new TestModule() );
     }
 
+    public void shutdown(Injector injector){
+        injector.getInstance(DataStaxCluster.class).shutdown();
+    }
 
     @Test
     public void testBasicOperation() throws Exception {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/queue/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/test/resources/log4j.properties 
b/stack/corepersistence/queue/src/test/resources/log4j.properties
index b81af29..45511fa 100644
--- a/stack/corepersistence/queue/src/test/resources/log4j.properties
+++ b/stack/corepersistence/queue/src/test/resources/log4j.properties
@@ -24,15 +24,16 @@ log4j.appender.stdout.layout.ConversionPattern=%d %p (%t) 
%c{1} - %m%n
 log4j.logger.org.apache.cassandra=WARN
 log4j.logger.org.glassfish=WARN
 
-log4j.logger.org.apache.usergrid.persistence.qakka=DEBUG
+log4j.logger.org.apache.usergrid.persistence.qakka=INFO
 log4j.logger.org.apache.usergrid.persistence.queue=INFO
 log4j.logger.org.apache.usergrid.corepersistence.asyncevents=INFO
 
 
#log4j.logger.org.apache.usergrid.persistence.qakka.serialization.queuemessages=TRACE
-log4j.logger.org.apache.usergrid.persistence.qakka.serialization.sharding=TRACE
+log4j.logger.org.apache.usergrid.persistence.qakka.serialization.sharding=INFO
 #log4j.logger.org.apache.usergrid.persistence.qakka.distributed.actors=TRACE
-log4j.logger.org.apache.usergrid.persistence.qakka.distributed.actors.ShardAllocator=TRACE
+log4j.logger.org.apache.usergrid.persistence.qakka.distributed.actors.ShardAllocator=INFO
 
+log4j.logger.org.safehaus.guicyfig.GuicyFigModule=ERROR
 log4j.logger.org.safehaus.guicyfig=ERROR
 
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/corepersistence/queue/src/test/resources/qakka.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/test/resources/qakka.properties 
b/stack/corepersistence/queue/src/test/resources/qakka.properties
index 11ef1b7..94bfeff 100644
--- a/stack/corepersistence/queue/src/test/resources/qakka.properties
+++ b/stack/corepersistence/queue/src/test/resources/qakka.properties
@@ -64,5 +64,5 @@ cassandra.keyspace.queue-message=qakka_test_queue_messages
 
 cassandra.keyspace-drop-and-create=true
 
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/rest/src/main/java/org/apache/usergrid/rest/ShutdownListener.java
----------------------------------------------------------------------
diff --git 
a/stack/rest/src/main/java/org/apache/usergrid/rest/ShutdownListener.java 
b/stack/rest/src/main/java/org/apache/usergrid/rest/ShutdownListener.java
index 8c96473..f21ba39 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/ShutdownListener.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/ShutdownListener.java
@@ -21,6 +21,7 @@ package org.apache.usergrid.rest;
 import com.google.inject.Injector;
 import org.apache.usergrid.batch.service.JobSchedulerService;
 import org.apache.usergrid.persistence.actorsystem.ActorSystemManager;
+import org.apache.usergrid.persistence.core.datastax.DataStaxCluster;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
@@ -67,6 +68,11 @@ public class ShutdownListener implements 
ServletContextListener {
         // leave akka cluster
         actorSystemManager.leaveCluster();
 
+        DataStaxCluster dataStaxCluster = 
injector.getInstance(DataStaxCluster.class);
+
+        // shutdown the connections to the database
+        dataStaxCluster.shutdown();
+
         boolean started = Boolean.parseBoolean(
             properties.getProperty(JobServiceBoostrap.START_SCHEDULER_PROP, 
"true"));
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/rest/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-custom-test.properties 
b/stack/rest/src/test/resources/usergrid-custom-test.properties
index c9aa362..59d117d 100644
--- a/stack/rest/src/test/resources/usergrid-custom-test.properties
+++ b/stack/rest/src/test/resources/usergrid-custom-test.properties
@@ -16,7 +16,7 @@
 # REST module test properties
 
 cassandra.startup=external
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 
 elasticsearch.startup=external

http://git-wip-us.apache.org/repos/asf/usergrid/blob/bb5d3f56/stack/services/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/services/src/test/resources/usergrid-custom-test.properties 
b/stack/services/src/test/resources/usergrid-custom-test.properties
index 291936a..f5fcb93 100644
--- a/stack/services/src/test/resources/usergrid-custom-test.properties
+++ b/stack/services/src/test/resources/usergrid-custom-test.properties
@@ -16,7 +16,7 @@
 # with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml)
 cassandra.startup=external
 elasticsearch.startup=external
-cassandra.connections=30
+#cassandra.connections=30
 cassandra.timeout.pool=20000
 
 #Poll interval to check for new jobs in millseconds. 10 milliseconds for 
testing

Reply via email to