Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324176

Summary: Dirty resources get re-index upon each query
Product: [Modeling] EMF Reporter: Axel Uhl <eclipse>
Component: Query2Assignee: Project Inbox <emf.query2-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: saurav.sarkar1
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Axel Uhl CLA 2010-09-01 06:05:01 EDT
Build Identifier: Query2 Prototype

When a query2 query is executed, all resources in the ResourceSet are re-visited for integration in a dirty-index, even in case they haven't changed since the last query. This causes a series of subsequent queries to perform very badly in case there is a significant amount of resources loaded in the ResourceSet.

Reproducible: Always

Steps to Reproduce:
1. Load a few large Resources into a ResourceSet
2. Fire the same MQL query using query2
3. Observe how the Resources in the ResourceSet get indexed for each query
Comment 1 saurav sarkar CLA 2010-12-17 03:04:30 EST
Hi Axel, 

An EContentAdapter called 'DirtyResourceFactory' has been introduced.This Adapter keeps track of the dirty index for a Query scenario.

This adapter has to be attached to the resource set or resources before the querying scenario and can be removed after user is done with the operation.

Please check Java Doc in the classes for more details.

Working of the DirtyResourceFactory, how it should be attached and removed have been captured in TestQueryBugs.java test class.

Please check the 'testDirtyResourceFactory_Bug324176' method in that class.

Best Regards,
Saurav
Comment 2 saurav sarkar CLA 2010-12-17 03:05:04 EST
Closing the bug