Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327388 - Make dirty state of local transactions available for server-side queries
Summary: Make dirty state of local transactions available for server-side queries
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Eike Stepper CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: Power to the People
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-10-09 07:02 EDT by Eike Stepper CLA
Modified: 2011-06-23 03:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Stepper CLA 2010-10-09 07:02:10 EDT
Sometimes it's desirable to make queries aware of local dirty state.
Comment 1 Eike Stepper CLA 2010-10-09 07:06:56 EDT
New API has been added to CDOTransaction:

  public CDOQuery createQuery(String language, String queryString, boolean considerDirtyState);
  public CDOQuery createQuery(String language, String queryString, Object context, boolean considerDirtyState);

An IQueryHandler can obtain the dirty state from the CDOQueryInfo passed into the executeQuery() method:

  public CDOChangeSetData getChangeSet();
  
The OCLQueryHandler uses this meachnism to provide a CDOView on the server that mimics the state of the dirty CDOTransaction on the client:

  public void executeQuery(CDOQueryInfo info, IQueryContext context)
  {
      ISession session = context.getView().getSession();
      CDOBranchPoint branchPoint = CDOBranchUtil.copyBranchPoint(context);

      CDORevisionProvider revisionProvider = context.getView();
      CDOChangeSetData changeSet = info.getChangeSet();
      if (changeSet != null)
      {
        revisionProvider = new CDOChangeSetRevisionProvider(revisionProvider, changeSet);
      }

      CDOView view = CDOServerUtil.openView(session, branchPoint, info.isLegacyModeEnabled(), revisionProvider);
      
      ...
      
}
Comment 2 Eike Stepper CLA 2010-10-09 07:07:32 EDT
Committed to HEAD
Comment 3 Eike Stepper CLA 2011-06-23 03:42:13 EDT
Available in R20110608-1407