This closes #2235 Make JDBC OpenFile Thread Safe

This commit is contained in:
andytaylor 2018-08-10 13:35:23 +01:00
commit 3ac7b9aef6
1 changed files with 8 additions and 6 deletions

View File

@ -108,6 +108,7 @@ public class JDBCSequentialFileFactoryDriver extends AbstractJDBCDriver {
* @throws SQLException * @throws SQLException
*/ */
public void openFile(JDBCSequentialFile file) throws SQLException { public void openFile(JDBCSequentialFile file) throws SQLException {
synchronized (connection) {
final long fileId = fileExists(file); final long fileId = fileExists(file);
if (fileId < 0) { if (fileId < 0) {
createFile(file); createFile(file);
@ -116,6 +117,7 @@ public class JDBCSequentialFileFactoryDriver extends AbstractJDBCDriver {
loadFile(file); loadFile(file);
} }
} }
}
void removeFile(JDBCSequentialFile file) { void removeFile(JDBCSequentialFile file) {