summaryrefslogtreecommitdiffstats
path: root/policy-core/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'policy-core/src/main/java')
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
index 49ff7bb8..389d5b37 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
@@ -190,6 +190,16 @@ public class PolicySession
}
/**
+ * Unset this 'PolicySession' instance as the one associated with the
+ * currently-running thread.
+ */
+ public void removePolicySession() {
+ if (policySess.get() == this) {
+ policySess.remove();
+ }
+ }
+
+ /**
* Get current session.
*
* @return the 'PolicySession' instance associated with the current thread
@@ -498,6 +508,8 @@ public class PolicySession
logger.error("startThread error in kieSession1.fireUntilHalt", e);
}
}
+
+ session.removePolicySession();
logger.info("fireUntilHalt() returned");
}
}