ARTEMIS-1992 Make JDBC File Lock map thread safe

This commit is contained in:
Martyn Taylor 2018-07-26 16:37:08 +01:00 committed by Clebert Suconic
parent 99bc916fdd
commit 06f6892454
1 changed files with 2 additions and 3 deletions

View File

@ -21,10 +21,10 @@ import java.io.File;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import org.apache.activemq.artemis.core.io.IOCriticalErrorListener; import org.apache.activemq.artemis.core.io.IOCriticalErrorListener;
@ -47,7 +47,7 @@ public class JDBCSequentialFileFactory implements SequentialFileFactory, ActiveM
private final Executor executor; private final Executor executor;
private final Map<String, Object> fileLocks = new HashMap<>(); private final Map<String, Object> fileLocks = new ConcurrentHashMap<>();
private JDBCSequentialFileFactoryDriver dbDriver; private JDBCSequentialFileFactoryDriver dbDriver;
@ -66,7 +66,6 @@ public class JDBCSequentialFileFactory implements SequentialFileFactory, ActiveM
} catch (SQLException e) { } catch (SQLException e) {
criticalErrorListener.onIOException(e, "Failed to start JDBC Driver", null); criticalErrorListener.onIOException(e, "Failed to start JDBC Driver", null);
} }
} }
public JDBCSequentialFileFactory(final String connectionUrl, public JDBCSequentialFileFactory(final String connectionUrl,