activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-976: PostgresSequentialSequentialFileDriver SQLProvider NPE fix
Date Thu, 16 Feb 2017 20:04:27 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master f900d8a97 -> bcecda73f


ARTEMIS-976: PostgresSequentialSequentialFileDriver SQLProvider NPE fix


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

Branch: refs/heads/master
Commit: fc70f9414a7ead589216e8e2aee6e19ab223a5fd
Parents: f900d8a
Author: dOkI <denis.kirpichenkov@gmail.com>
Authored: Fri Feb 17 00:35:49 2017 +0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Feb 16 15:00:42 2017 -0500

----------------------------------------------------------------------
 .../artemis/jdbc/store/file/JDBCFileUtils.java      |  5 ++---
 .../PostgresSequentialSequentialFileDriver.java     | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fc70f941/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
index b5f1aa6..1bfdd70 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCFileUtils.java
@@ -44,8 +44,7 @@ class JDBCFileUtils {
    static JDBCSequentialFileFactoryDriver getDBFileDriver(DataSource dataSource, SQLProvider
provider) throws SQLException {
       JDBCSequentialFileFactoryDriver dbDriver;
       if (provider instanceof PostgresSQLProvider) {
-         dbDriver = new PostgresSequentialSequentialFileDriver();
-         dbDriver.setDataSource(dataSource);
+         dbDriver = new PostgresSequentialSequentialFileDriver(dataSource, provider);
       } else {
          dbDriver = new JDBCSequentialFileFactoryDriver(dataSource, provider);
       }
@@ -55,7 +54,7 @@ class JDBCFileUtils {
    static JDBCSequentialFileFactoryDriver getDBFileDriver(Connection connection, SQLProvider
provider) throws SQLException {
       JDBCSequentialFileFactoryDriver dbDriver;
       if (provider instanceof PostgresSQLProvider) {
-         dbDriver = new PostgresSequentialSequentialFileDriver();
+         dbDriver = new PostgresSequentialSequentialFileDriver(connection, provider);
          dbDriver.setConnection(connection);
       } else {
          dbDriver = new JDBCSequentialFileFactoryDriver(connection, provider);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/fc70f941/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresSequentialSequentialFileDriver.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresSequentialSequentialFileDriver.java
b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresSequentialSequentialFileDriver.java
index cdc167f..85d4813 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresSequentialSequentialFileDriver.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/PostgresSequentialSequentialFileDriver.java
@@ -17,14 +17,18 @@
 package org.apache.activemq.artemis.jdbc.store.file;
 
 import java.nio.ByteBuffer;
+import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 
+import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider;
 import org.postgresql.PGConnection;
 import org.postgresql.largeobject.LargeObject;
 import org.postgresql.largeobject.LargeObjectManager;
 
+import javax.sql.DataSource;
+
 @SuppressWarnings("SynchronizeOnNonFinalField")
 public final class PostgresSequentialSequentialFileDriver extends JDBCSequentialFileFactoryDriver
{
 
@@ -34,6 +38,18 @@ public final class PostgresSequentialSequentialFileDriver extends JDBCSequential
       super();
    }
 
+   public PostgresSequentialSequentialFileDriver(DataSource dataSource, SQLProvider provider)
{
+      super();
+      this.setDataSource(dataSource);
+      this.setSqlProvider(provider);
+   }
+
+   public PostgresSequentialSequentialFileDriver(Connection connection, SQLProvider provider)
{
+      super();
+      this.setConnection(connection);
+      this.setSqlProvider(provider);
+   }
+
    @Override
    protected void prepareStatements() throws SQLException {
       this.deleteFile = connection.prepareStatement(sqlProvider.getDeleteFileSQL());


Mime
View raw message