提交 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 { ...@@ -384,6 +384,8 @@ public class LogFile {
} catch (OutOfMemoryError e) { } catch (OutOfMemoryError e) {
// OutOfMemoryError means not enough memory is allocated to the VM. // OutOfMemoryError means not enough memory is allocated to the VM.
// this is not necessarily at the end of the log file // 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); throw Message.convert(e);
} catch (Throwable e) { } catch (Throwable e) {
database.getTrace(Trace.LOG).error("Error reading log file (non-fatal)", e); database.getTrace(Trace.LOG).error("Error reading log file (non-fatal)", e);
......
...@@ -648,6 +648,15 @@ public class LogSystem { ...@@ -648,6 +648,15 @@ public class LogSystem {
public void setDisabled(boolean disabled) { public void setDisabled(boolean disabled) {
this.disabled = disabled; 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 * Add a redo log entry to the file. This method is called when re-applying
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论