You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ma...@apache.org on 2017/04/03 11:13:05 UTC

[1/3] activemq-artemis git commit: ARTEMIS-1085 Perform storelineup on appendRecord

Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x f94f8f471 -> 200088778


ARTEMIS-1085 Perform storelineup on appendRecord

(cherry picked from commit 120b8aa7ad314b30bca082fb4f809bfa15a1dea1)


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

Branch: refs/heads/1.x
Commit: 200088778e2517d299ad3e3efa315ecafc8a8c41
Parents: bae011b
Author: Martyn Taylor <mt...@redhat.com>
Authored: Thu Mar 30 16:25:17 2017 +0100
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Mon Apr 3 12:12:33 2017 +0100

----------------------------------------------------------------------
 .../jdbc/store/journal/JDBCJournalImpl.java        | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/20008877/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java
index eb7cda1..a548157 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/journal/JDBCJournalImpl.java
@@ -167,8 +167,6 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
       boolean success = false;
       try {
          for (JDBCJournalRecord record : recordRef) {
-            record.storeLineUp();
-
             switch (record.getRecordType()) {
                case JDBCJournalRecord.DELETE_RECORD:
                   // Standard SQL Delete Record, Non transactional delete
@@ -222,16 +220,16 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
             cleanupTxRecords(deletedRecords, committedTransactions);
       } catch (SQLException e) {
          logger.warn("Failed to remove the Tx Records", e.getMessage(), e);
+      } finally {
+         executeCallbacks(recordRef, success);
       }
 
-      executeCallbacks(recordRef, success);
       return recordRef.size();
    }
 
    /* We store Transaction reference in memory (once all records associated with a Tranascation are Deleted,
       we remove the Tx Records (i.e. PREPARE, COMMIT). */
    private synchronized void cleanupTxRecords(List<Long> deletedRecords, List<Long> committedTx) throws SQLException {
-      connection.rollback();
       List<RecordInfo> iterableCopy;
       List<TransactionHolder> iterableCopyTx = new ArrayList<>();
       iterableCopyTx.addAll(transactions.values());
@@ -262,6 +260,8 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
 
    private void performRollback(List<JDBCJournalRecord> records) {
       try {
+         connection.rollback();
+
          for (JDBCJournalRecord record : records) {
             if (record.isTransactional() || record.getRecordType() == JDBCJournalRecord.PREPARE_RECORD) {
                removeTxRecord(record);
@@ -297,9 +297,10 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
    }
 
    private void appendRecord(JDBCJournalRecord record) throws Exception {
+      record.storeLineUp();
 
       SimpleWaitIOCallback callback = null;
-      if (record.isSync() && record.getIoCompletion() == null && !record.isTransactional()) {
+      if (record.isSync() && record.getIoCompletion() == null) {
          callback = new SimpleWaitIOCallback();
          record.setIoCompletion(callback);
       }
@@ -316,8 +317,9 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
 
       syncTimer.delay();
 
-      if (callback != null)
+      if (callback != null) {
          callback.waitCompletion();
+      }
    }
 
    private synchronized void addTxRecord(JDBCJournalRecord record) {
@@ -504,6 +506,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
    public void appendCommitRecord(long txID, boolean sync) throws Exception {
       JDBCJournalRecord r = new JDBCJournalRecord(-1, JDBCJournalRecord.COMMIT_RECORD, seq.incrementAndGet());
       r.setTxId(txID);
+      r.setSync(sync);
       appendRecord(r);
    }
 
@@ -511,6 +514,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
    public void appendCommitRecord(long txID, boolean sync, IOCompletion callback) throws Exception {
       JDBCJournalRecord r = new JDBCJournalRecord(-1, JDBCJournalRecord.COMMIT_RECORD, seq.incrementAndGet());
       r.setTxId(txID);
+      r.setSync(sync);
       r.setIoCompletion(callback);
       appendRecord(r);
    }
@@ -524,6 +528,7 @@ public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal {
       r.setTxId(txID);
       r.setStoreLineUp(lineUpContext);
       r.setIoCompletion(callback);
+      r.setSync(sync);
       appendRecord(r);
    }
 


[2/3] activemq-artemis git commit: ARTEMIS-1087 Make InVM buffer pooling configurable

Posted by ma...@apache.org.
ARTEMIS-1087 Make InVM buffer pooling configurable

(cherry picked from commit 8760b3ddfd0ea52a0417ce91b6abe4840ca5ddca)


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

Branch: refs/heads/1.x
Commit: bae011bafb85532945451eab7e10e6a757022939
Parents: 7e4cb4d
Author: Martyn Taylor <mt...@redhat.com>
Authored: Fri Mar 31 13:13:46 2017 +0100
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Mon Apr 3 12:12:33 2017 +0100

----------------------------------------------------------------------
 .../activemq/artemis/api/core/ActiveMQBuffers.java       |  2 --
 .../artemis/core/remoting/impl/invm/InVMAcceptor.java    |  5 +++++
 .../artemis/core/remoting/impl/invm/InVMConnection.java  | 11 ++++++++---
 .../artemis/core/remoting/impl/invm/InVMConnector.java   |  6 ++++++
 .../core/remoting/impl/invm/TransportConstants.java      |  4 ++++
 5 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bae011ba/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java
----------------------------------------------------------------------
diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java
index 32f9279..bacb841 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffers.java
@@ -27,7 +27,6 @@ import org.apache.activemq.artemis.core.buffers.impl.ChannelBufferWrapper;
  */
 public final class ActiveMQBuffers {
 
-
    private static final PooledByteBufAllocator ALLOCATOR = PooledByteBufAllocator.DEFAULT;
 
    /**
@@ -44,7 +43,6 @@ public final class ActiveMQBuffers {
       return new ChannelBufferWrapper(ALLOCATOR.heapBuffer(size),true, true);
    }
 
-
    /**
     * Creates a <em>self-expanding</em> ActiveMQBuffer filled with the given byte array
     *

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bae011ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
index 9c26b47..398baa4 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMAcceptor.java
@@ -72,6 +72,8 @@ public final class InVMAcceptor extends AbstractAcceptor {
 
    private static final Logger logger = Logger.getLogger(InVMAcceptor.class);
 
+   private final boolean enableBufferPooling;
+
    public InVMAcceptor(final String name,
                        final ClusterConnection clusterConnection,
                        final Map<String, Object> configuration,
@@ -96,6 +98,8 @@ public final class InVMAcceptor extends AbstractAcceptor {
       executorFactory = new OrderedExecutorFactory(threadPool);
 
       connectionsAllowed = ConfigurationHelper.getLongProperty(TransportConstants.CONNECTIONS_ALLOWED, TransportConstants.DEFAULT_CONNECTIONS_ALLOWED, configuration);
+
+      enableBufferPooling = ConfigurationHelper.getBooleanProperty(TransportConstants.BUFFER_POOLING, TransportConstants.DEFAULT_BUFFER_POOLING, configuration);
    }
 
    @Override
@@ -222,6 +226,7 @@ public final class InVMAcceptor extends AbstractAcceptor {
       Listener connectionListener = new Listener(connector);
 
       InVMConnection inVMConnection = new InVMConnection(id, connectionID, remoteHandler, connectionListener, clientExecutor, defaultActiveMQPrincipal);
+      inVMConnection.setEnableBufferPooling(enableBufferPooling);
 
       connectionListener.connectionCreated(this, inVMConnection, protocolMap.get(ActiveMQClient.DEFAULT_CORE_PROTOCOL));
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bae011ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java
index 24931d3..1bd1bac 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnection.java
@@ -63,6 +63,8 @@ public class InVMConnection implements Connection {
 
    private RemotingConnection protocolConnection;
 
+   private boolean bufferPoolingEnabled = TransportConstants.DEFAULT_BUFFER_POOLING;
+
    public InVMConnection(final int serverID,
                          final BufferHandler handler,
                          final BaseConnectionLifeCycleListener listener,
@@ -97,6 +99,10 @@ public class InVMConnection implements Connection {
       this.defaultActiveMQPrincipal = defaultActiveMQPrincipal;
    }
 
+   public void setEnableBufferPooling(boolean enableBufferPooling) {
+      this.bufferPoolingEnabled = enableBufferPooling;
+   }
+
    @Override
    public void forceClose() {
       // no op
@@ -151,11 +157,10 @@ public class InVMConnection implements Connection {
 
    @Override
    public ActiveMQBuffer createTransportBuffer(final int size, boolean pooled) {
-      if ( pooled ) {
+      if (bufferPoolingEnabled && pooled) {
          return ActiveMQBuffers.pooledBuffer( size );
-      } else {
-         return ActiveMQBuffers.dynamicBuffer( size );
       }
+      return ActiveMQBuffers.dynamicBuffer( size );
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bae011ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
index 907fb40..51e917d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/InVMConnector.java
@@ -95,6 +95,8 @@ public class InVMConnector extends AbstractConnector {
 
    private final Executor closeExecutor;
 
+   private final boolean bufferPoolingEnabled;
+
    private static ExecutorService threadPoolExecutor;
 
    public static synchronized void resetThreadPool() {
@@ -126,6 +128,8 @@ public class InVMConnector extends AbstractConnector {
 
       id = ConfigurationHelper.getIntProperty(TransportConstants.SERVER_ID_PROP_NAME, 0, configuration);
 
+      bufferPoolingEnabled = ConfigurationHelper.getBooleanProperty(TransportConstants.BUFFER_POOLING, TransportConstants.DEFAULT_BUFFER_POOLING, configuration);
+
       this.handler = handler;
 
       this.closeExecutor = closeExecutor;
@@ -215,6 +219,8 @@ public class InVMConnector extends AbstractConnector {
                                                  final Executor serverExecutor) {
       // No acceptor on a client connection
       InVMConnection inVMConnection = new InVMConnection(id, handler, listener, serverExecutor);
+      inVMConnection.setEnableBufferPooling(bufferPoolingEnabled);
+
       listener.connectionCreated(null, inVMConnection, protocolManager);
       return inVMConnection;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bae011ba/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/TransportConstants.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/TransportConstants.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/TransportConstants.java
index f8a5117..c02b0fd 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/TransportConstants.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/remoting/impl/invm/TransportConstants.java
@@ -26,6 +26,10 @@ public final class TransportConstants {
 
    public static final long DEFAULT_CONNECTIONS_ALLOWED = -1L;
 
+   public static final String BUFFER_POOLING = "bufferPooling";
+
+   public static final boolean DEFAULT_BUFFER_POOLING = true;
+
    private TransportConstants() {
       // Utility class
    }


[3/3] activemq-artemis git commit: ARTEMIS-1084 Throw RunTime on bad Oracle table size

Posted by ma...@apache.org.
ARTEMIS-1084 Throw RunTime on bad Oracle table size

(cherry picked from commit 42bf845)


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

Branch: refs/heads/1.x
Commit: 7e4cb4d1813b6f4f5bc5ae28bc7cd194dad5d14a
Parents: f94f8f4
Author: Martyn Taylor <mt...@redhat.com>
Authored: Wed Mar 29 14:37:45 2017 +0100
Committer: Martyn Taylor <mt...@redhat.com>
Committed: Mon Apr 3 12:12:33 2017 +0100

----------------------------------------------------------------------
 .../artemis/jdbc/store/drivers/JDBCUtils.java        |  4 ++--
 .../jdbc/store/drivers/derby/DerbySQLProvider.java   |  8 ++++----
 .../jdbc/store/drivers/mysql/MySQLSQLProvider.java   |  8 ++++----
 .../store/drivers/oracle/Oracle12CSQLProvider.java   | 11 +++++++----
 .../store/drivers/postgres/PostgresSQLProvider.java  |  8 ++++----
 .../artemis/jdbc/store/sql/GenericSQLProvider.java   | 10 +++++++---
 .../activemq/artemis/jdbc/store/sql/SQLProvider.java |  7 +++++--
 .../jdbc/file/JDBCSequentialFileFactoryTest.java     |  3 ++-
 .../core/paging/impl/PagingStoreFactoryDatabase.java |  8 ++++----
 .../impl/journal/JDBCJournalStorageManager.java      | 12 ++++++------
 .../config/impl/DatabaseStoreConfigurationTest.java  | 15 +++++++++++++++
 .../artemis/tests/util/ActiveMQTestBase.java         |  2 +-
 .../jdbc/store/journal/JDBCJournalTest.java          |  2 +-
 13 files changed, 62 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java
index 802d856..bbe4865 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCUtils.java
@@ -51,7 +51,7 @@ public class JDBCUtils {
       return factory;
    }
 
-   public static SQLProvider getSQLProvider(String driverClass, String tableName) {
+   public static SQLProvider getSQLProvider(String driverClass, String tableName, SQLProvider.DatabaseStoreType storeType) {
       SQLProvider.Factory factory;
       if (driverClass.contains("derby")) {
          logger.tracef("getSQLProvider Returning Derby SQL provider for driver::%s, tableName::%s", driverClass, tableName);
@@ -69,7 +69,7 @@ public class JDBCUtils {
          logger.tracef("getSQLProvider Returning generic SQL provider for driver::%s, tableName::%s", driverClass, tableName);
          factory = new GenericSQLProvider.Factory();
       }
-      return factory.create(tableName);
+      return factory.create(tableName, storeType);
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/derby/DerbySQLProvider.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/derby/DerbySQLProvider.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/derby/DerbySQLProvider.java
index 8f279d1..2ffff14 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/derby/DerbySQLProvider.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/derby/DerbySQLProvider.java
@@ -26,8 +26,8 @@ public class DerbySQLProvider extends GenericSQLProvider {
 
    private final String createFileTableSQL;
 
-   private DerbySQLProvider(String tableName) {
-      super(tableName.toUpperCase());
+   private DerbySQLProvider(String tableName, DatabaseStoreType databaseStoreType) {
+      super(tableName.toUpperCase(), databaseStoreType);
 
       createFileTableSQL = "CREATE TABLE " + tableName +
          "(ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1)," +
@@ -52,8 +52,8 @@ public class DerbySQLProvider extends GenericSQLProvider {
    public static class Factory implements SQLProvider.Factory {
 
       @Override
-      public SQLProvider create(String tableName) {
-         return new DerbySQLProvider(tableName);
+      public SQLProvider create(String tableName, DatabaseStoreType databaseStoreType) {
+         return new DerbySQLProvider(tableName, databaseStoreType);
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/mysql/MySQLSQLProvider.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/mysql/MySQLSQLProvider.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/mysql/MySQLSQLProvider.java
index 6e01c45..744ccef 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/mysql/MySQLSQLProvider.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/mysql/MySQLSQLProvider.java
@@ -29,8 +29,8 @@ public class MySQLSQLProvider extends GenericSQLProvider {
 
    private final String copyFileRecordByIdSQL;
 
-   private MySQLSQLProvider(String tName) {
-      super(tName.toLowerCase());
+   private MySQLSQLProvider(String tName, DatabaseStoreType databaseStoreType) {
+      super(tName.toLowerCase(), databaseStoreType);
 
       createFileTableSQL = "CREATE TABLE " + tableName +
          "(ID BIGINT NOT NULL AUTO_INCREMENT," +
@@ -68,8 +68,8 @@ public class MySQLSQLProvider extends GenericSQLProvider {
    public static class Factory implements SQLProvider.Factory {
 
       @Override
-      public SQLProvider create(String tableName) {
-         return new MySQLSQLProvider(tableName);
+      public SQLProvider create(String tableName, DatabaseStoreType databaseStoreType) {
+         return new MySQLSQLProvider(tableName, databaseStoreType);
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/oracle/Oracle12CSQLProvider.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/oracle/Oracle12CSQLProvider.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/oracle/Oracle12CSQLProvider.java
index accddfd..1e5cf2a 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/oracle/Oracle12CSQLProvider.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/oracle/Oracle12CSQLProvider.java
@@ -32,8 +32,11 @@ public class Oracle12CSQLProvider extends GenericSQLProvider {
 
    private static final long MAX_BLOB_SIZE = 4294967296L; //4GB
 
-   protected Oracle12CSQLProvider(String tableName) {
-      super(tableName);
+   protected Oracle12CSQLProvider(String tableName, DatabaseStoreType databaseStoreType) {
+      super(tableName.toUpperCase(), databaseStoreType);
+      if (tableName.length() > 10 && databaseStoreType == DatabaseStoreType.PAGE) {
+         throw new RuntimeException("The maximum name size for the paging store table, when using Oracle12C is 10 characters.");
+      }
    }
 
    @Override
@@ -54,8 +57,8 @@ public class Oracle12CSQLProvider extends GenericSQLProvider {
    public static class Factory implements SQLProvider.Factory {
 
       @Override
-      public SQLProvider create(String tableName) {
-         return new Oracle12CSQLProvider(tableName);
+      public SQLProvider create(String tableName, DatabaseStoreType databaseStoreType) {
+         return new Oracle12CSQLProvider(tableName, databaseStoreType);
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/postgres/PostgresSQLProvider.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/postgres/PostgresSQLProvider.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/postgres/PostgresSQLProvider.java
index 6deaf64..495f17b 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/postgres/PostgresSQLProvider.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/postgres/PostgresSQLProvider.java
@@ -28,8 +28,8 @@ public class PostgresSQLProvider extends GenericSQLProvider {
 
    private final String[] createJournalTableSQL;
 
-   private PostgresSQLProvider(String tName) {
-      super(tName.toLowerCase());
+   private PostgresSQLProvider(String tName, DatabaseStoreType databaseStoreType) {
+      super(tName.toLowerCase(), databaseStoreType);
       createFileTableSQL = "CREATE TABLE " + tableName +
          "(ID BIGSERIAL, FILENAME VARCHAR(255), EXTENSION VARCHAR(10), DATA OID, PRIMARY KEY(ID))";
 
@@ -57,8 +57,8 @@ public class PostgresSQLProvider extends GenericSQLProvider {
    public static class Factory implements SQLProvider.Factory {
 
       @Override
-      public SQLProvider create(String tableName) {
-         return new PostgresSQLProvider(tableName);
+      public SQLProvider create(String tableName, DatabaseStoreType databaseStoreType) {
+         return new PostgresSQLProvider(tableName, databaseStoreType);
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/GenericSQLProvider.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/GenericSQLProvider.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/GenericSQLProvider.java
index 3b452cd..9232001 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/GenericSQLProvider.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/GenericSQLProvider.java
@@ -57,9 +57,13 @@ public class GenericSQLProvider implements SQLProvider {
 
    private final String countJournalRecordsSQL;
 
-   protected GenericSQLProvider(String tableName) {
+   protected final DatabaseStoreType databaseStoreType;
+
+   protected GenericSQLProvider(String tableName, DatabaseStoreType databaseStoreType) {
       this.tableName = tableName;
 
+      this.databaseStoreType = databaseStoreType;
+
       createFileTableSQL = "CREATE TABLE " + tableName +
          "(ID BIGINT AUTO_INCREMENT, FILENAME VARCHAR(255), EXTENSION VARCHAR(10), DATA BLOB, PRIMARY KEY(ID))";
 
@@ -205,8 +209,8 @@ public class GenericSQLProvider implements SQLProvider {
    public static class Factory implements SQLProvider.Factory {
 
       @Override
-      public SQLProvider create(String tableName) {
-         return new GenericSQLProvider(tableName);
+      public SQLProvider create(String tableName, DatabaseStoreType storeType) {
+         return new GenericSQLProvider(tableName, storeType);
       }
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/SQLProvider.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/SQLProvider.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/SQLProvider.java
index 8d82883..1663179 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/SQLProvider.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/sql/SQLProvider.java
@@ -18,6 +18,10 @@ package org.apache.activemq.artemis.jdbc.store.sql;
 
 public interface SQLProvider {
 
+   enum DatabaseStoreType {
+      PAGE, MESSAGE_JOURNAL, BINDINGS_JOURNAL, LARGE_MESSAGE
+   }
+
    long getMaxBlobSize();
 
    String[] getCreateJournalTableSQL();
@@ -59,7 +63,6 @@ public interface SQLProvider {
    boolean closeConnectionOnShutdown();
 
    interface Factory {
-
-      SQLProvider create(String tableName);
+      SQLProvider create(String tableName, DatabaseStoreType dbStoreType);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java
index 75bdf44..b7d0c9d 100644
--- a/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java
+++ b/artemis-jdbc-store/src/test/java/org/apache/activemq/artemis/jdbc/file/JDBCSequentialFileFactoryTest.java
@@ -35,6 +35,7 @@ import org.apache.activemq.artemis.core.io.SequentialFile;
 import org.apache.activemq.artemis.jdbc.store.drivers.JDBCUtils;
 import org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFile;
 import org.apache.activemq.artemis.jdbc.store.file.JDBCSequentialFileFactory;
+import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider;
 import org.apache.activemq.artemis.utils.ActiveMQThreadFactory;
 import org.apache.activemq.artemis.utils.ThreadLeakCheckRule;
 import org.apache.derby.jdbc.EmbeddedDriver;
@@ -63,7 +64,7 @@ public class JDBCSequentialFileFactoryTest {
 
       String connectionUrl = "jdbc:derby:target/data;create=true";
       String tableName = "FILES";
-      factory = new JDBCSequentialFileFactory(connectionUrl, className, JDBCUtils.getSQLProvider(className, tableName), executor);
+      factory = new JDBCSequentialFileFactory(connectionUrl, className, JDBCUtils.getSQLProvider(className, tableName, SQLProvider.DatabaseStoreType.PAGE), executor);
       factory.start();
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryDatabase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryDatabase.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryDatabase.java
index 7917165..5fd262e 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryDatabase.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreFactoryDatabase.java
@@ -104,10 +104,10 @@ public class PagingStoreFactoryDatabase implements PagingStoreFactory {
             if (sqlProviderFactory == null) {
                sqlProviderFactory = new GenericSQLProvider.Factory();
             }
-            pagingFactoryFileFactory = new JDBCSequentialFileFactory(dbConf.getDataSource(), sqlProviderFactory.create(dbConf.getPageStoreTableName()), executorFactory.getExecutor());
+            pagingFactoryFileFactory = new JDBCSequentialFileFactory(dbConf.getDataSource(), sqlProviderFactory.create(dbConf.getPageStoreTableName(), SQLProvider.DatabaseStoreType.PAGE), executorFactory.getExecutor());
          } else {
             String driverClassName = dbConf.getJdbcDriverClassName();
-            pagingFactoryFileFactory = new JDBCSequentialFileFactory(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getPageStoreTableName()), executorFactory.getExecutor());
+            pagingFactoryFileFactory = new JDBCSequentialFileFactory(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getPageStoreTableName(), SQLProvider.DatabaseStoreType.PAGE), executorFactory.getExecutor());
          }
          pagingFactoryFileFactory.start();
          started = true;
@@ -212,9 +212,9 @@ public class PagingStoreFactoryDatabase implements PagingStoreFactory {
       SQLProvider sqlProvider = null;
       if (dbConf.getDataSource() != null) {
          SQLProvider.Factory sqlProviderFactory = dbConf.getSqlProviderFactory() == null ? new GenericSQLProvider.Factory() : dbConf.getSqlProviderFactory();
-         sqlProvider = sqlProviderFactory.create(getTableNameForGUID(directoryName));
+         sqlProvider = sqlProviderFactory.create(getTableNameForGUID(directoryName), SQLProvider.DatabaseStoreType.PAGE);
       } else {
-         sqlProvider = JDBCUtils.getSQLProvider(dbConf.getJdbcDriverClassName(), getTableNameForGUID(directoryName));
+         sqlProvider = JDBCUtils.getSQLProvider(dbConf.getJdbcDriverClassName(), getTableNameForGUID(directoryName), SQLProvider.DatabaseStoreType.PAGE);
       }
 
       return  new JDBCSequentialFileFactory(pagingFactoryFileFactory.getDbDriver().getConnection(), sqlProvider, executorFactory.getExecutor());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JDBCJournalStorageManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JDBCJournalStorageManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JDBCJournalStorageManager.java
index 416da0b..8634638 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JDBCJournalStorageManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/JDBCJournalStorageManager.java
@@ -62,14 +62,14 @@ public class JDBCJournalStorageManager extends JournalStorageManager {
             if (sqlProviderFactory == null) {
                sqlProviderFactory = new GenericSQLProvider.Factory();
             }
-            bindingsJournal = new JDBCJournalImpl(dbConf.getDataSource(), sqlProviderFactory.create(dbConf.getBindingsTableName()), dbConf.getBindingsTableName(), scheduledExecutorService, executorFactory.getExecutor());
-            messageJournal = new JDBCJournalImpl(dbConf.getDataSource(), sqlProviderFactory.create(dbConf.getMessageTableName()), dbConf.getMessageTableName(), scheduledExecutorService, executorFactory.getExecutor());
-            largeMessagesFactory = new JDBCSequentialFileFactory(dbConf.getDataSource(), sqlProviderFactory.create(dbConf.getLargeMessageTableName()), executor);
+            bindingsJournal = new JDBCJournalImpl(dbConf.getDataSource(), sqlProviderFactory.create(dbConf.getBindingsTableName(), SQLProvider.DatabaseStoreType.BINDINGS_JOURNAL), dbConf.getBindingsTableName(), scheduledExecutorService, executorFactory.getExecutor());
+            messageJournal = new JDBCJournalImpl(dbConf.getDataSource(), sqlProviderFactory.create(dbConf.getMessageTableName(), SQLProvider.DatabaseStoreType.MESSAGE_JOURNAL), dbConf.getMessageTableName(), scheduledExecutorService, executorFactory.getExecutor());
+            largeMessagesFactory = new JDBCSequentialFileFactory(dbConf.getDataSource(), sqlProviderFactory.create(dbConf.getLargeMessageTableName(), SQLProvider.DatabaseStoreType.LARGE_MESSAGE), executor);
          } else {
             String driverClassName = dbConf.getJdbcDriverClassName();
-            bindingsJournal = new JDBCJournalImpl(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getBindingsTableName()), scheduledExecutorService, executorFactory.getExecutor());
-            messageJournal = new JDBCJournalImpl(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getMessageTableName()), scheduledExecutorService, executorFactory.getExecutor());
-            largeMessagesFactory = new JDBCSequentialFileFactory(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getLargeMessageTableName()), executor);
+            bindingsJournal = new JDBCJournalImpl(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getBindingsTableName(), SQLProvider.DatabaseStoreType.BINDINGS_JOURNAL), scheduledExecutorService, executorFactory.getExecutor());
+            messageJournal = new JDBCJournalImpl(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getMessageTableName(), SQLProvider.DatabaseStoreType.MESSAGE_JOURNAL), scheduledExecutorService, executorFactory.getExecutor());
+            largeMessagesFactory = new JDBCSequentialFileFactory(dbConf.getJdbcConnectionUrl(), driverClassName, JDBCUtils.getSQLProvider(driverClassName, dbConf.getLargeMessageTableName(), SQLProvider.DatabaseStoreType.LARGE_MESSAGE), executor);
          }
          largeMessagesFactory.start();
       } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DatabaseStoreConfigurationTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DatabaseStoreConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DatabaseStoreConfigurationTest.java
index 4934cbd..27e3593 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DatabaseStoreConfigurationTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/DatabaseStoreConfigurationTest.java
@@ -20,6 +20,8 @@ import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.FileDeploymentManager;
 import org.apache.activemq.artemis.core.config.StoreConfiguration;
 import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
+import org.apache.activemq.artemis.jdbc.store.drivers.oracle.Oracle12CSQLProvider;
+import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Test;
 
@@ -32,6 +34,19 @@ public class DatabaseStoreConfigurationTest extends ActiveMQTestBase {
       assertEquals(StoreConfiguration.StoreType.DATABASE, server.getConfiguration().getStoreConfiguration().getStoreType());
    }
 
+   @Test
+   public void testOracle12TableSize() {
+      Throwable rte = null;
+      try {
+         new Oracle12CSQLProvider.Factory().create("A_TABLE_NAME_THAT_IS_TOO_LONG", SQLProvider.DatabaseStoreType.PAGE);
+      } catch (Throwable t) {
+         rte = t;
+      }
+
+      assertNotNull(rte);
+      assertTrue(rte.getMessage().contains("The maximum name size for the paging store table, when using Oracle12C is 10 characters."));
+   }
+
    protected Configuration createConfiguration(String fileName) throws Exception {
       FileConfiguration fc = new FileConfiguration();
       FileDeploymentManager deploymentManager = new FileDeploymentManager(fileName);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
index 6fbf808..7d10245 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java
@@ -474,7 +474,7 @@ public abstract class ActiveMQTestBase extends Assert {
       try {
          for (String tableName : tableNames) {
             connection.setAutoCommit(false);
-            SQLProvider sqlProvider = JDBCUtils.getSQLProvider(getJDBCClassName(), tableName);
+            SQLProvider sqlProvider = JDBCUtils.getSQLProvider(getJDBCClassName(), tableName, SQLProvider.DatabaseStoreType.LARGE_MESSAGE);
             try (ResultSet rs = connection.getMetaData().getTables(null, null, sqlProvider.getTableName(), null)) {
                if (rs.next()) {
                   statement.execute("DROP TABLE " + sqlProvider.getTableName());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7e4cb4d1/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java
index d600ac1..ebb5c0e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jdbc/store/journal/JDBCJournalTest.java
@@ -77,7 +77,7 @@ public class JDBCJournalTest extends ActiveMQTestBase {
       executorService = Executors.newSingleThreadExecutor();
       jdbcUrl = "jdbc:derby:target/data;create=true";
       SQLProvider.Factory factory = new DerbySQLProvider.Factory();
-      journal = new JDBCJournalImpl(jdbcUrl, DRIVER_CLASS, factory.create(JOURNAL_TABLE_NAME), scheduledExecutorService, executorService);
+      journal = new JDBCJournalImpl(jdbcUrl, DRIVER_CLASS, factory.create(JOURNAL_TABLE_NAME, SQLProvider.DatabaseStoreType.MESSAGE_JOURNAL), scheduledExecutorService, executorService);
       journal.start();
    }