Bug 1317058 - [GSS](6.2.z)Deletion of logically inserted Fact fails in 6.2
[GSS](6.2.z)Deletion of logically inserted Fact fails in 6.2
Status: VERIFIED
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.2.0
All All
urgent Severity high
: CR1
: 6.2.3
Assigned To: Mario Fusco
Ivo Bek
:
Depends On: 1317026
Blocks: 1327763 1327765
  Show dependency treegraph
 
Reported: 2016-03-11 15:14 EST by Alessandro Lazarotti
Modified: 2017-01-21 07:42 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1317026
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alessandro Lazarotti 2016-03-11 15:14:45 EST
+++ This bug was initially created as a clone of Bug #1317026 +++

Description of problem:
When the user tries to delete a Fact that was inserted using the 'insertLogical()' operation, the deletion fails with the below exception:

---------- Exception ---------- 
java.lang.IllegalArgumentException: The FactHandle did not originate from WM : [fact 0:1:1990421361:1990421361:1:DEFAULT:NON_TRAIT:com.company.support.DecisionTableFactValue:com.company.support.DecisionTableFactValue@76a36b71]
	at org.drools.core.common.NamedEntryPoint.delete(NamedEntryPoint.java:474)
	at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1505)
	at org.drools.core.impl.StatefulKnowledgeSessionImpl.delete(StatefulKnowledgeSessionImpl.java:1496)
	at com.company.support.DecisionTableRuleTest.factInsertedInWorkingMemoryCannotBeDeleted(DecisionTableRuleTest.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:643)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	....

---------- Exception ---------- 

Version-Release number of selected component (if applicable):
6.2.0

How reproducible:
Everytime delete() is executed on a logically inserted Fact.

Steps to Reproduce:
1. Logically insert some fact.
2. Retrieve FactHandle for inserted fact (either via query or KieSession.getFactHandles()).
3. Delete fact using ksession.delete()

Actual results:
Fact deleted.

Expected results:
Exception thrown.

Additional info:
Reproducer attached. Please unzip and unit test DecisionTableRuleTest to see the exception reproduced.

--- Additional comment from JBoss Product and Program Management on 2016-03-11 13:10:17 EST ---

Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

--- Additional comment from Alessandro Lazarotti on 2016-03-11 14:55:38 EST ---

Mario see that it works for 6.2.x branch, but not for 6.3.x, so could be a regression.

If it is not a regression, but a new check added to 6.3.x so:
- Should be incremented the community doc first (to be consumed for product doc) in the TMS chapeter, mentioning that such operation should not be allowed.
- The exception should be clear. An Illegal Operation Exception can be thrown reporting as message something like "Deleting a fact inserted logically is not supported currently".
Comment 3 Ivo Bek 2016-05-04 07:00:50 EDT
Verified in BPM Suite 6.2.3.CR1

The reproducer test DecisionTableRuleTest passed.

Note You need to log in before you can comment on or make changes to this bug.