[udig-devel] [jira] Created: (UDIG-909) LayerImpl.setFilter() and rendering concurrency problem

Mark Presling (JIRA) jira at codehaus.org
Mon Jul 10 16:45:22 PDT 2006


LayerImpl.setFilter() and rendering concurrency problem
-------------------------------------------------------

         Key: UDIG-909
         URL: http://jira.codehaus.org/browse/UDIG-909
     Project: uDIG
        Type: Bug

  Components: map  
    Versions: UDIG 1.1.M7    
 Environment: All platforms
    Reporter: Mark Presling
 Assigned to: Jesse Eichar 


Note that this relates to code of uDig 1.1.M7 era, but I believe that it has not been resolved as of yet.

When using LayerImpl.setFilter() to specify a filter for the SelectionLayer of a WFS layer there are occasionally concurrency issues with the renderer or FeatureSource/DataStore. Occasionally the SelectionLayer will be rendered with the underlying layers query and sometimes the main layer is rendered with the SelectionLayer query. This means that either only one feature will be rendered and highlighted (assuming the selection filter is for one feature) or all features will be rendered and highlighted.

A simple fix for this is to change the renderer to synchronize the call to render():

    private void render(Graphics2D graphics, Envelope bounds, IProgressMonitor monitor) throws RenderException {
        synchronized (BasicFeatureRenderer.class) {
            unsafeRender(graphics, bounds, monitor);
        }
    }
    
    private void unsafeRender(Graphics2D graphics, Envelope bounds,
            IProgressMonitor monitor) throws RenderException {
... original render() code here ...
    }

So, this shows that the issue is probably deeper down inside the GeoTools DataStore level. Because each instance of the renderer (the layer and the selection layer) has the same FeatureSource, and the queries to the GeoServer contains the same filter for both calls (as evident in the GeoServer logs).

This issue took a long time to track down to this level. I have been unable to go deeper into the GeoTools stack to find the root cause. If more information is required please don't hesitate to ask.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the udig-devel mailing list