Bug 1032059 - RETE-OO: Reversed live query results order compared to PHREAK
Summary: RETE-OO: Reversed live query results order compared to PHREAK
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: BRE
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Edson Tirelli
QA Contact: Marek Winkler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-19 13:25 UTC by Marek Winkler
Modified: 2013-11-19 14:53 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-11-19 14:53:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Maven project with reproducer (13.96 KB, application/zip)
2013-11-19 13:25 UTC, Marek Winkler
no flags Details

Description Marek Winkler 2013-11-19 13:25:58 UTC
Created attachment 826055 [details]
Maven project with reproducer

Description of problem:

Live queries return results in different order with PHREAK and with RETE. 

For instance, imagine you define a live query (KieSession.openLiveQuery()) which returns two rows, A and B. If you attach a ViewChangedEventListener to the query, the ViewChangedEventListener.rowInserted(Row) method gets called as follows:

PHREAK: 
  ViewChangedEventListener.rowInserted(A), 
  ViewChangedEventListener.rowInserted(B)

RETEOO:
  ViewChangedEventListener.rowInserted(B),
  ViewChangedEventListener.rowInserted(A)

I am not sure if this is by design or a bug, or just the order of query results is not guaranteed in general.

Could someone from engineering comment this?

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

Drools 6.0.0-SNAPSHOT
BRMS 6.0.0 ER4

How reproducible:

Run LiveQueriesTest from the attached Maven project with setting drools engine to RETE:

mvn clean test -Dtest=LiveQueriesTest -Ddrools.ruleEngine=reteoo

The query results order is reversed when executed with PHREAK:

mvn clean test -Dtest=LiveQueriesTest -Ddrools.ruleEngine=phreak

Comment 2 Mark Proctor 2013-11-19 14:51:33 UTC
There is no guarantee on the order the rows will be produced for a single rule. This is something that has and will change over time, as we optimise internal data structures. It's even changed between ReteOO versions.


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