提交 8e7003d9 authored 作者: Thomas Mueller's avatar Thomas Mueller

MVStore: if there is an exception while saving, the store is now in all cases immediately closed.

上级 ac21a340
...@@ -17,9 +17,11 @@ Change Log ...@@ -17,9 +17,11 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>In version 1.3.183, indexes that contains columns with a default value <ul><li>In version 1.3.183, indexes were not used if the table contains
generated by a sequence where not used. This includes identity and auto-increment columns with a default value generated by a sequence.
columns. This bug was introduced by supporting "rownum" in views and derived tables. This includes tables with identity and auto-increment columns.
This bug was introduced by supporting "rownum" in views and derived tables.
</li><li>MVStore: if there is an exception while saving, the store is now in all cases immediately closed.
</li></ul> </li></ul>
<h2>Version 1.4.183 Beta (2014-12-13)</h2> <h2>Version 1.4.183 Beta (2014-12-13)</h2>
......
...@@ -977,6 +977,15 @@ public class MVStore { ...@@ -977,6 +977,15 @@ public class MVStore {
} }
private long storeNow() { private long storeNow() {
try {
return storeNowTry();
} catch (IllegalStateException e) {
panic(e);
return -1;
}
}
private long storeNowTry() {
freeUnusedChunks(); freeUnusedChunks();
int currentUnsavedPageCount = unsavedMemory; int currentUnsavedPageCount = unsavedMemory;
long storeVersion = currentStoreVersion; long storeVersion = currentStoreVersion;
...@@ -1156,7 +1165,6 @@ public class MVStore { ...@@ -1156,7 +1165,6 @@ public class MVStore {
shrinkFileIfPossible(1); shrinkFileIfPossible(1);
} }
try {
for (MVMap<?, ?> m : changed) { for (MVMap<?, ?> m : changed) {
Page p = m.getRoot(); Page p = m.getRoot();
if (p.getTotalCount() > 0) { if (p.getTotalCount() > 0) {
...@@ -1164,9 +1172,6 @@ public class MVStore { ...@@ -1164,9 +1172,6 @@ public class MVStore {
} }
} }
metaRoot.writeEnd(); metaRoot.writeEnd();
} catch (IllegalStateException e) {
panic(e);
}
// some pages might have been changed in the meantime (in the newest // some pages might have been changed in the meantime (in the newest
// version) // version)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论