mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-10 14:11:59 +00:00
Merge remote-tracking branch
'origin/GP-4798_ghidra1_CorrectedDTArchiveTransactionError' (Closes #6768)
This commit is contained in:
commit
d88350e718
@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@ -319,7 +319,7 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
||||
|
||||
private void initPackedDatabase(ResourceFile packedDBfile, OpenMode openMode,
|
||||
TaskMonitor monitor) throws CancelledException, IOException {
|
||||
long txId = dbHandle.startTransaction();
|
||||
Long txId = dbHandle.startTransaction();
|
||||
try {
|
||||
init(openMode, monitor);
|
||||
|
||||
@ -337,6 +337,9 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
||||
}
|
||||
catch (VersionException e) {
|
||||
if (openMode == OpenMode.UPDATE && e.isUpgradable()) {
|
||||
// Try again with UPGRADE mode
|
||||
dbHandle.endTransaction(txId, true);
|
||||
txId = null;
|
||||
initPackedDatabase(packedDBfile, OpenMode.UPGRADE, monitor);
|
||||
}
|
||||
else {
|
||||
@ -345,7 +348,9 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
|
||||
}
|
||||
}
|
||||
finally {
|
||||
dbHandle.endTransaction(txId, true);
|
||||
if (txId != null) {
|
||||
dbHandle.endTransaction(txId, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@ -836,7 +836,7 @@ public class StandAloneDataTypeManager extends DataTypeManagerDB implements Clos
|
||||
}
|
||||
|
||||
protected void initTransactionState() {
|
||||
dbHandle.setMaxUndos(NUM_UNDOS);
|
||||
clearUndo();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -953,6 +953,8 @@ public class StandAloneDataTypeManager extends DataTypeManagerDB implements Clos
|
||||
protected synchronized void clearUndo() {
|
||||
undoList.clear();
|
||||
redoList.clear();
|
||||
dbHandle.setMaxUndos(0);
|
||||
dbHandle.setMaxUndos(NUM_UNDOS);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1037,7 +1039,12 @@ public class StandAloneDataTypeManager extends DataTypeManagerDB implements Clos
|
||||
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
clearUndo();
|
||||
if (dbHandle.isTransactionActive()) {
|
||||
Msg.error(this, "DTM closed with active transaction",
|
||||
new RuntimeException("DTM closed with active transaction"));
|
||||
}
|
||||
undoList.clear();
|
||||
redoList.clear();
|
||||
if (!dbHandle.isClosed()) {
|
||||
dbHandle.close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user