Quantcast

[1/2] activemq-artemis git commit: ARTEMIS-976: PostgresSequentialSequentialFileDriver SQLProvider NPE fix

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

[1/2] activemq-artemis git commit: ARTEMIS-976: PostgresSequentialSequentialFileDriver SQLProvider NPE fix

clebertsuconic-2
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 <[hidden email]>
Authored: Fri Feb 17 00:35:49 2017 +0500
Committer: Clebert Suconic <[hidden email]>
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());

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[2/2] activemq-artemis git commit: This closes #1023

clebertsuconic-2
This closes #1023


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

Branch: refs/heads/master
Commit: bcecda73f52e37ab8e0cea4456c0bf8b5cd2c2eb
Parents: f900d8a fc70f94
Author: Clebert Suconic <[hidden email]>
Authored: Thu Feb 16 15:04:15 2017 -0500
Committer: Clebert Suconic <[hidden email]>
Committed: Thu Feb 16 15:04:15 2017 -0500

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


Loading...