private boolean useFullSyncWithUndo = false;
protected void update(ReadGraph graph) throws DatabaseException {
- synchronized (syncMutex) {
- if (DEBUG) System.out.println("Graph update start");
-
- if (runUndo && useFullSyncWithUndo) {
+ if (DEBUG) System.out.println("Graph update start");
+
+ if (runUndo && useFullSyncWithUndo) {
+ synchronized (syncMutex) {
reset(graph);
- } else {
+ }
+ } else {
+ synchronized (syncMutex) {
graphUpdates = true;
for (DBObject domainObject : mapping.getDomainModified()) {
@SuppressWarnings("unchecked")
if (rangeObject != null)
graphModified.add(rangeObject);
}
- mapping.updateRange(graph);
+
+ }
+
+ mapping.updateRange(graph);
+
+ synchronized (syncMutex) {
graphModified.clear();
syncDeletes();
- clearDeletes();
- graphUpdates = false;
- }
-
- if (mapping.isRangeModified() && !runUndo && !runRedo)
- commit((String)null);
+ }
- if (DEBUG) System.out.println("Graph update done");
+ clearDeletes();
+ graphUpdates = false;
}
+
+ if (mapping.isRangeModified() && !runUndo && !runRedo)
+ commit((String)null);
+
+ if (DEBUG) System.out.println("Graph update done");
}
@Override
* This code here synchronizes removed and added objects to collect deletable objects. (a deletable object is one which is removed but not added).
*
*/
- @SuppressWarnings("unused")
protected void syncDeletes() {
deleteUC.clear();
for (Pair<E, String> n : removed) {
/**
* Clears deletable objects from mapping cache.
*/
- @SuppressWarnings("unused")
protected void clearDeletes() {
if (DEBUG && delete.size() > 0) System.out.println("Delete");
for (E n : delete) {