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,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);
}
}
}