[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] Feature Caching
|
I think you may be right - it's to do with the datastore implementation,
or at least I get different results from different datastores. It's just
got even more confusing though...
1. With a shapefile datastore, the filter works as expected and redraws
the correct data after changing the IDs in the FID filter and with a map
refresh.
2. With the MySql datastore, the filter is applied when the layer is
added/created but the rendered data stays the same for the lifetime of
the layer, even after changing the IDs in the filter and refreshing the
map (and even after a shutdown/restart).
3. With the PostGIS datastore, the filter just isn't applied at all.
Here's what I do in my LayerInterceptor (for testing this)...
@Override
public void run(Layer layer) {
if ("well".equals(layer.getName())) {
Filter filter = new DatasetSelectionFilter();
layer.getBlackboard().put(ShowViewInterceptor.KEY, filter);
}
}
The DatasetSelectionFilter class is just a wrapper round an Id filter
(or an INCLUDE filter if no filtering is required). This class listens
for events that the app fires when the global dataset selection changes
- it replaces the wrapped filter when the event fires.
So I feel a bit further away from understanding what's going on - but
maybe this extra information will give someone on here an idea!
Thanks
Jesse Eichar wrote:
On Mon, Aug 24, 2009 at 5:21 PM, Dave S-B
<dev-lists@xxxxxxxxxxxxxxxxxxxxx
<mailto:dev-lists@xxxxxxxxxxxxxxxxxxxxx>> wrote:
It is a confusing class! ;)
The ShowViewInterceptor is exactly right for what I'm doing so
I've changed everything over to use that, rather than filtering at
the IGeoResource level - it definitely keeps everything much
cleaner. Unfortunately, it still suffers from the same problem.
Someone somewhere is caching things so that, in order to see the
filter change, you have to remove the layer and add it back in
again. It's now persisting the original Filter (i.e. the one in
place when the layer was first created) as well, so even closing
the application down and opening it up again doesn't refresh the
data! I need to dig more...
The cache doesn't seem to be accessible from outside of the
LayerResource class - I think everything's in
ResourceCacheInterceptor instance which is held in the
interceptors collection. Is there any way of clearing it or
stopping it from caching the FeatureStore? Maybe I'm looking in
the wrong place...
Seems really odd. I thought that interceptor was applied after the
resource was retrieved from the cache. If not then that is a bug. It
should be applied after the cache. I see that it is a POST
interceptor. I have not used MySQL datastore. maybe you can verify
that the same problem occurs when using a Postgres datastore or a
shapefile. I suspect the problem may be related to the MySQL
datastore implementation.
Jesse