[Mulgara-svn] r1848 - branches/distinct_queries/src/jar/resolver-store/java/org/mulgara/store/statement/xa11

pag at mulgara.org pag at mulgara.org
Thu Nov 19 11:57:45 UTC 2009


Author: pag
Date: 2009-11-19 03:57:44 -0800 (Thu, 19 Nov 2009)
New Revision: 1848

Modified:
   branches/distinct_queries/src/jar/resolver-store/java/org/mulgara/store/statement/xa11/XA11StatementStoreImpl.java
Log:
Fixed problem where added graphs from a phase to be committed were not being propagated to the immediately following phase since they had not finished the commit process yet. Now manually updating the new phase, and then telling the phase to scan for this data manually if the prepare operation fails.

Modified: branches/distinct_queries/src/jar/resolver-store/java/org/mulgara/store/statement/xa11/XA11StatementStoreImpl.java
===================================================================
--- branches/distinct_queries/src/jar/resolver-store/java/org/mulgara/store/statement/xa11/XA11StatementStoreImpl.java	2009-11-19 11:55:54 UTC (rev 1847)
+++ branches/distinct_queries/src/jar/resolver-store/java/org/mulgara/store/statement/xa11/XA11StatementStoreImpl.java	2009-11-19 11:57:44 UTC (rev 1848)
@@ -661,11 +661,15 @@
     // check that prepare() was not caleld twice
     if (prepared) throw new SimpleXAResourceException("prepare() called twice.");
 
+    Phase newCurrent = null;
     try {
       // Perform a prepare.
       recordingPhaseToken = currentPhase.use();
       Phase recordingPhase = currentPhase;
-      new Phase();
+      // new Phase() has a side effect of setting the current phase, but we'll keep a local copy anyway
+      newCurrent = new Phase();
+      // could not set up the committed graphs yet, so send them in after the fact
+      newCurrent.graphNodes = recordingPhase.graphNodes;
 
       // Ensure that all data associated with the phase is on disk.
       for (int i = 0; i < NR_INDEXES; ++i) tripleAVLFiles[i].force();
@@ -699,6 +703,11 @@
           recordingPhaseToken.release();
           recordingPhaseToken = null;
         }
+        try {
+          newCurrent.graphNodes = newCurrent.scanForGraphs();
+        } catch (Exception e) {
+          logger.error("Error reading graphs while handling exception from phase.prepare", e);
+        }
       }
     }
   }




More information about the Mulgara-svn mailing list