You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/10/26 17:42:09 UTC
[1/2] isis git commit: ISIS-1515: adds a guard in
BackgroundCommandExecution for in case priorExecution is null (can happen if
attempts to invoke an action on an object that no longer exists)
Repository: isis
Updated Branches:
refs/heads/master c34f543e9 -> 1be09cc68
ISIS-1515: adds a guard in BackgroundCommandExecution for in case priorExecution is null (can happen if attempts to invoke an action on an object that no longer exists)
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/8da21a3a
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/8da21a3a
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/8da21a3a
Branch: refs/heads/master
Commit: 8da21a3a841cd4e11146f6de4730f1b1673d1c13
Parents: 314ed28
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Oct 26 18:19:35 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Oct 26 18:26:48 2016 +0100
----------------------------------------------------------------------
.../background/BackgroundCommandExecution.java | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/8da21a3a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
index ba6d03d..6787c25 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
@@ -16,6 +16,7 @@
*/
package org.apache.isis.core.runtime.services.background;
+import java.sql.Timestamp;
import java.util.Collections;
import java.util.List;
@@ -183,10 +184,15 @@ public abstract class BackgroundCommandExecution extends AbstractIsisSessionTemp
final ObjectAdapter resultAdapter = objectAction.execute(
targetAdapter, null, argAdapters, InteractionInitiatedBy.FRAMEWORK);
+ //
// for the result adapter, we could alternatively have used...
- Object unused = backgroundInteraction.getPriorExecution().getReturned();
+ // (priorExecution populated by the push/pop within the interaction object)
+ //
+ // final Interaction.Execution priorExecution = backgroundInteraction.getPriorExecution();
+ // Object unused = priorExecution.getReturned();
+ //
- // this doesn't really make sense if >1 action
+ // REVIEW: this doesn't really make sense if >1 action
// in any case, the capturing of the action interaction should be the
// responsibility of auditing/profiling
if(resultAdapter != null) {
@@ -230,8 +236,14 @@ public abstract class BackgroundCommandExecution extends AbstractIsisSessionTemp
transactionManager.getCurrentTransaction().clearAbortCauseAndContinue();
}
+ // it's possible that there is no priorExecution, specifically if there was an exception
+ // invoking the action. We therefore need to guard that case.
final Interaction.Execution priorExecution = backgroundInteraction.getPriorExecution();
- backgroundCommand.setCompletedAt(priorExecution.getCompletedAt());
+ final Timestamp completedAt =
+ priorExecution != null
+ ? priorExecution.getCompletedAt()
+ : clockService.nowAsJavaSqlTimestamp(); // close enough...
+ backgroundCommand.setCompletedAt(completedAt);
}
private ObjectAction findObjectAction(
[2/2] isis git commit: Merge branch 'maint-1.13.1'
Posted by da...@apache.org.
Merge branch 'maint-1.13.1'
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/1be09cc6
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/1be09cc6
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/1be09cc6
Branch: refs/heads/master
Commit: 1be09cc68608d711d31a33d949ac3ca645210a80
Parents: c34f543 8da21a3
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Oct 26 18:30:19 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Oct 26 18:30:19 2016 +0100
----------------------------------------------------------------------
.../background/BackgroundCommandExecution.java | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------