提交 e4877c9c authored 作者: Thomas Mueller's avatar Thomas Mueller

Opening a large database was slow if there was a problem opening the previous time.

上级 fa65d743
......@@ -384,6 +384,8 @@ public class LogFile {
} catch (OutOfMemoryError e) {
// OutOfMemoryError means not enough memory is allocated to the VM.
// this is not necessarily at the end of the log file
// set the log system to read only so the current log file stays when closing
logSystem.setReadOnly(true);
throw Message.convert(e);
} catch (Throwable e) {
database.getTrace(Trace.LOG).error("Error reading log file (non-fatal)", e);
......
......@@ -649,6 +649,15 @@ public class LogSystem {
this.disabled = disabled;
}
/**
* Set the read only flag for this log system.
*
* @param readOnly the new value
*/
void setReadOnly(boolean readOnly) {
this.readOnly = readOnly;
}
/**
* Add a redo log entry to the file. This method is called when re-applying
* the log entries (when opening a database).
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论