[1/2] activemq-artemis git commit: ARTEMIS-1165 Artemis 1.x JMS bindings doesn't handle JDBC network problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/2] activemq-artemis git commit: ARTEMIS-1165 Artemis 1.x JMS bindings doesn't handle JDBC network problems

andytaylor-2
Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x 7ed40326c -> 1cbadb08d


ARTEMIS-1165 Artemis 1.x JMS bindings doesn't handle JDBC network problems


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

Branch: refs/heads/1.x
Commit: fa8283f56c98d191624db35852b1cd0e7527a3fd
Parents: 7ed4032
Author: Francesco Nigro <[hidden email]>
Authored: Tue May 16 10:49:52 2017 +0200
Committer: Francesco Nigro <[hidden email]>
Committed: Wed May 17 15:00:10 2017 +0200

----------------------------------------------------------------------
 .../impl/journal/JMSJournalStorageManagerImpl.java          | 9 +++++++--
 .../artemis/jms/server/impl/JMSServerManagerImpl.java       | 2 +-
 .../integration/persistence/StorageManagerTestBase.java     | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fa8283f5/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java
index 9cd3976..feddf9c 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/persistence/impl/journal/JMSJournalStorageManagerImpl.java
@@ -85,6 +85,7 @@ public final class JMSJournalStorageManagerImpl implements JMSStorageManager {
    // Constructors --------------------------------------------------
 
    public JMSJournalStorageManagerImpl(ExecutorFactory ioExecutors,
+                                       ExecutorFactory executorFactory,
                                        final IDGenerator idGenerator,
                                        final Configuration config,
                                        final ReplicationManager replicator,
@@ -99,8 +100,8 @@ public final class JMSJournalStorageManagerImpl implements JMSStorageManager {
 
       createDir = config.isCreateBindingsDir();
 
-      Journal localJMS;
       if (config.getStoreConfiguration() != null && config.getStoreConfiguration().getStoreType() == StoreConfiguration.StoreType.DATABASE) {
+         final JDBCJournalImpl localJMS;
          DatabaseStorageConfiguration dbConf = (DatabaseStorageConfiguration) config.getStoreConfiguration();
          if (dbConf.getDataSource() != null) {
             SQLProvider.Factory sqlProviderFactory = dbConf.getSqlProviderFactory();
@@ -112,10 +113,14 @@ public final class JMSJournalStorageManagerImpl implements JMSStorageManager {
             String driverClassName = dbConf.getJdbcDriverClassName();
             localJMS = new JDBCJournalImpl(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getJMSBindingsTableName(), SQLProvider.DatabaseStoreType.BINDINGS_JOURNAL), scheduledExecutorService, ioExecutors.getExecutor(), criticalErrorListener);
          }
+         final int networkTimeout = dbConf.getJdbcNetworkTimeout();
+         if (networkTimeout >= 0) {
+            localJMS.setNetworkTimeout(executorFactory.getExecutor(), networkTimeout);
+         }
          jmsJournal = localJMS;
       } else {
          SequentialFileFactory bindingsJMS = new NIOSequentialFileFactory(config.getBindingsLocation(), 1);
-         localJMS = new JournalImpl(ioExecutors, 1024 * 1024, 2, config.getJournalPoolFiles(), config.getJournalCompactMinFiles(), config.getJournalCompactPercentage(), bindingsJMS, "activemq-jms", "jms", 1, 0);
+         final Journal localJMS = new JournalImpl(ioExecutors, 1024 * 1024, 2, config.getJournalPoolFiles(), config.getJournalCompactMinFiles(), config.getJournalCompactPercentage(), bindingsJMS, "activemq-jms", "jms", 1, 0);
 
          if (replicator != null) {
             jmsJournal = new ReplicatedJournal((byte) 2, localJMS, replicator);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fa8283f5/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
index 9ce3299..a3eaa85 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/impl/JMSServerManagerImpl.java
@@ -1552,7 +1552,7 @@ public class JMSServerManagerImpl implements JMSServerManager, ActivateCallback
          storage.stop();
       }
       if (coreConfig.isPersistenceEnabled()) {
-         storage = new JMSJournalStorageManagerImpl(server.getIOExecutorFactory(), new TimeAndCounterIDGenerator(), server.getConfiguration(), server.getReplicationManager(), server.getScheduledPool(), activeMQserver.getCriticalIOErrorListener());
+         storage = new JMSJournalStorageManagerImpl(server.getIOExecutorFactory(), server.getExecutorFactory(), new TimeAndCounterIDGenerator(), server.getConfiguration(), server.getReplicationManager(), server.getScheduledPool(), activeMQserver.getCriticalIOErrorListener());
       } else {
          storage = new NullJMSStorageManagerImpl();
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fa8283f5/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java
index 9504417..aba1304 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/persistence/StorageManagerTestBase.java
@@ -155,7 +155,7 @@ public abstract class StorageManagerTestBase extends ActiveMQTestBase {
     * @throws Exception
     */
    protected void createJMSStorage() throws Exception {
-      jmsJournal = new JMSJournalStorageManagerImpl(null, new TimeAndCounterIDGenerator(), createDefaultInVMConfig(), null, scheduledExecutorService, null);
+      jmsJournal = new JMSJournalStorageManagerImpl(null, execFactory, new TimeAndCounterIDGenerator(), createDefaultInVMConfig(), null, scheduledExecutorService, null);
       addActiveMQComponent(jmsJournal);
       jmsJournal.start();
       jmsJournal.load();

Reply | Threaded
Open this post in threaded view
|

[2/2] activemq-artemis git commit: This closes #1273 ARTEMIS-1165 Artemis 1.x JMS bindings doesn't handle JDBC network problems

andytaylor-2
This closes #1273 ARTEMIS-1165 Artemis 1.x JMS bindings doesn't handle JDBC network problems


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/1cbadb08
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/1cbadb08
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/1cbadb08

Branch: refs/heads/1.x
Commit: 1cbadb08d76daa6628c4a6dbf44b2857a9cb3d62
Parents: 7ed4032 fa8283f
Author: Andy Taylor <[hidden email]>
Authored: Wed May 17 14:21:06 2017 +0100
Committer: Andy Taylor <[hidden email]>
Committed: Wed May 17 14:21:06 2017 +0100

----------------------------------------------------------------------
 .../impl/journal/JMSJournalStorageManagerImpl.java          | 9 +++++++--
 .../artemis/jms/server/impl/JMSServerManagerImpl.java       | 2 +-
 .../integration/persistence/StorageManagerTestBase.java     | 2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------