← Back to team overview

slub.team team mailing list archive

[Merge] lp:~zeutschel/goobi-production/bug-987717 into lp:goobi-production

 

Matthias Ronge has proposed merging lp:~zeutschel/goobi-production/bug-987717 into lp:goobi-production.

Requested reviews:
  Ralf Claussnitzer (ralf-claussnitzer)
Related bugs:
  Bug #987717 in Goobi.Production: "crash on process creation if history cannot be updated"
  https://bugs.launchpad.net/goobi-production/+bug/987717

For more details, see:
https://code.launchpad.net/~zeutschel/goobi-production/bug-987717/+merge/103669

The patch has been added.
-- 
https://code.launchpad.net/~zeutschel/goobi-production/bug-987717/+merge/103669
Your team Saxon State Library Team is subscribed to branch lp:goobi-production.
=== modified file 'src/de/sub/goobi/forms/ProzesskopieForm.java'
--- src/de/sub/goobi/forms/ProzesskopieForm.java	2012-02-22 11:26:21 +0000
+++ src/de/sub/goobi/forms/ProzesskopieForm.java	2012-04-26 11:31:22 +0000
@@ -684,6 +684,7 @@
 		// Adding process to history
 		if (!HistoryAnalyserJob.updateHistoryForProcess(prozessKopie)) {
 			Helper.setFehlerMeldung("historyNotUpdated");
+			return "";
 		} else {
 			try {
 				new ProzessDAO().save(prozessKopie);

=== modified file 'src/org/goobi/production/flow/jobs/HistoryAnalyserJob.java'
--- src/org/goobi/production/flow/jobs/HistoryAnalyserJob.java	2012-02-22 07:43:02 +0000
+++ src/org/goobi/production/flow/jobs/HistoryAnalyserJob.java	2012-04-26 11:31:22 +0000
@@ -137,10 +137,14 @@
 		 * these something is wrong, timestamp pattern overrules status, in that
 		 * case status gets changed to match one of these pattern
 		 * 
-		 * status begin in work work done 0 null null null 1 null null null 2
-		 * set set null 3 set set set
-		 * 
-		 * 
+		 * <pre>
+		 *         status |  begin    in work    work done
+		 *         -------+-------------------------------  
+		 *           0    |  null     null       null
+		 *           1    |  null     null       null
+		 *           2    |  set      set        null
+		 *           3    |  set      set        set
+		 * </pre>
 		 */
 
 		for (Schritt step : inProcess.getSchritteList()) {
@@ -510,19 +514,16 @@
 		return duplicateEventRemoved;
 	}
 
-	public static Boolean updateHistoryForProcess(Prozess inProc){
-		Boolean updated;
+	public static Boolean updateHistoryForProcess(Prozess inProc) {
+		Boolean updated = false;
 		try {
 			updated = updateHistory(inProc);
-		} catch (IOException e) {
-		} catch (InterruptedException e) {
-		} catch (SwapException e) {
-		} catch (DAOException e) {
+			updated = updateHistoryForSteps(inProc);
+		} catch (Exception ex) {
+			logger.warn("Updating history failed.", ex);
+			updated = false;
 		}
-		updated = updateHistoryForSteps(inProc);
-		
 		return updated;
-		
 	}
 
 }


Follow ups