Bug 1032059 - RETE-OO: Reversed live query results order compared to PHREAK
RETE-OO: Reversed live query results order compared to PHREAK
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Edson Tirelli
Marek Winkler
Depends On:
  Show dependency treegraph
Reported: 2013-11-19 08:25 EST by Marek Winkler
Modified: 2013-11-19 09:53 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-19 09:53:39 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Marek Winkler 2013-11-19 08:25:58 EST
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:



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 09:51:33 EST
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.