You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by an...@apache.org on 2018/08/10 12:36:33 UTC
[1/2] activemq-artemis git commit: This closes #2235 Make JDBC
OpenFile Thread Safe
Repository: activemq-artemis
Updated Branches:
refs/heads/master f346347b0 -> 3ac7b9aef
This closes #2235 Make JDBC OpenFile Thread Safe
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3ac7b9ae
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3ac7b9ae
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3ac7b9ae
Branch: refs/heads/master
Commit: 3ac7b9aef6be0e7d864f7ba4166baf445168e055
Parents: f346347 af90bc5
Author: andytaylor <an...@gmail.com>
Authored: Fri Aug 10 13:35:23 2018 +0100
Committer: andytaylor <an...@gmail.com>
Committed: Fri Aug 10 13:35:23 2018 +0100
----------------------------------------------------------------------
.../store/file/JDBCSequentialFileFactoryDriver.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
[2/2] activemq-artemis git commit: Make OpenFile Thread Safe
Posted by an...@apache.org.
Make OpenFile Thread Safe
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/af90bc5f
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/af90bc5f
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/af90bc5f
Branch: refs/heads/master
Commit: af90bc5f435c8e8acaa524602067dbbc5606a662
Parents: f346347
Author: Martyn Taylor <mt...@redhat.com>
Authored: Wed Aug 1 17:54:35 2018 +0100
Committer: andytaylor <an...@gmail.com>
Committed: Fri Aug 10 13:35:23 2018 +0100
----------------------------------------------------------------------
.../store/file/JDBCSequentialFileFactoryDriver.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/af90bc5f/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java
----------------------------------------------------------------------
diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java
index 14ad25e..e736dca 100644
--- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java
+++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactoryDriver.java
@@ -108,12 +108,14 @@ public class JDBCSequentialFileFactoryDriver extends AbstractJDBCDriver {
* @throws SQLException
*/
public void openFile(JDBCSequentialFile file) throws SQLException {
- final long fileId = fileExists(file);
- if (fileId < 0) {
- createFile(file);
- } else {
- file.setId(fileId);
- loadFile(file);
+ synchronized (connection) {
+ final long fileId = fileExists(file);
+ if (fileId < 0) {
+ createFile(file);
+ } else {
+ file.setId(fileId);
+ loadFile(file);
+ }
}
}