GP-1 Corrected regrerssion failure

This commit is contained in:
ghidra1
2026-07-16 14:08:02 -04:00
parent 88e1c2b612
commit b3381bb526

View File

@@ -519,6 +519,7 @@ public class DBHandle {
if (commit) {
masterTable.flush();
if (bufferMgr.checkpoint()) {
cachedChangedState = isChanged();
++checkpointNum;
return true;
}
@@ -532,15 +533,13 @@ public class DBHandle {
}
}
finally {
if (commit) {
cachedChangedState = isChanged();
}
txStarted = false;
}
return false;
}
private void cacheChangedState() {
// Must be invoked from within a synchronized block when no transaction is active
cachedChangedState = bufferMgr != null && bufferMgr.isChanged();
}
@@ -550,7 +549,10 @@ public class DBHandle {
*
* @return current modification count
*/
public long getModCount() {
public synchronized long getModCount() {
if (bufferMgr == null) {
return txStartingModCount; // ballpark value (database has been closed)
}
return bufferMgr.getModCount();
}
@@ -715,26 +717,6 @@ public class DBHandle {
return tables.size();
}
/**
* Revert the current database version to an older version.
* @param oldVersion
* @param monitor
* @return boolean
* @throws IllegalStateException if the database has modified prior to
* invoking this method.
* @throws IllegalArgumentException if this method is invoked more than
* once or the version file(s) are corrupt.
*/
// boolean revert(int oldVersion, TaskMonitor monitor) throws IOException {
// for (int v = (version-1); v >= oldVersion; --v) {
// monitor.setMessage("Processing Version " + v);
// bufferMgr.applyVersionFile(db.getVersionFile(v), monitor);
// if (monitor.isCancelled())
// return false;
// }
// return true;
// }
/**
* Close the database and dispose of the underlying buffer manager.
* Any existing recovery data will be discarded.
@@ -773,8 +755,8 @@ public class DBHandle {
*
* @return true if unsaved changes have been made.
*/
public boolean isChanged() {
if (txStarted) {
public synchronized boolean isChanged() {
if (bufferMgr != null && txStarted) {
return cachedChangedState || txStartingModCount != getModCount();
}
return cachedChangedState;