提交 1228d4e7 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Do not use File.deleteOnExit() for Database.createTempFile()

上级 53b11416
...@@ -1956,8 +1956,7 @@ public class Database implements DataHandler { ...@@ -1956,8 +1956,7 @@ public class Database implements DataHandler {
if (!persistent) { if (!persistent) {
name = "memFS:" + name; name = "memFS:" + name;
} }
return FileUtils.createTempFile(name, return FileUtils.createTempFile(name, Constants.SUFFIX_TEMP_FILE, false, inTempDir);
Constants.SUFFIX_TEMP_FILE, true, inTempDir);
} catch (IOException e) { } catch (IOException e) {
throw DbException.convertIOException(e, databaseName); throw DbException.convertIOException(e, databaseName);
} }
......
...@@ -143,6 +143,7 @@ public class UndoLog { ...@@ -143,6 +143,7 @@ public class UndoLog {
if (file == null) { if (file == null) {
String fileName = database.createTempFile(); String fileName = database.createTempFile();
file = database.openFile(fileName, "rw", false); file = database.openFile(fileName, "rw", false);
file.autoDelete();
file.setCheckedWriting(false); file.setCheckedWriting(false);
file.setLength(FileStore.HEADER_LENGTH); file.setLength(FileStore.HEADER_LENGTH);
} }
...@@ -160,7 +161,6 @@ public class UndoLog { ...@@ -160,7 +161,6 @@ public class UndoLog {
storedEntries += records.size(); storedEntries += records.size();
memoryUndo = 0; memoryUndo = 0;
records.clear(); records.clear();
file.autoDelete();
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论