Thanks Andrea,

I've figure out another workaround for this problem. All you need to do is
add another parameter with some random data. This means that the factory
won't find it in the cache.

// Try to confuse the factory cache...
String random = String.valueOf(System.currentTimeMillis());
connectionParameters.put("DummyParameter", random);

Not the neatest solution, but it works!

Jon

On 25 July 2011 13:39, Andrea Aime <[email protected]> wrote:

> On Mon, Jul 25, 2011 at 12:33 PM, Jon Britton
> <[email protected]> wrote:
> > Hi,
> > I'm using the Geotools WFS plugin to retrieve a list of WFS layers from
> my
> > server. When I first call "data = (WFSDataStore)
> > DataStoreFinder.getDataStore(connectionParameters);" it creates a
> > GetCapabilities request to my WFS server (it shows in the server logs).
> > However, when I try this a second time no GetCapabilities request is made
> > (it doesn't appear in my server logs, anyway), so I assume the previous
> > results are being used.
> > Is there any way I can make Geotools make a GetCapabilities request every
> > time I call getDataStore(..)? I need the results to reflect recent
> changes
> > to the WFS.
>
> I can see in the wfs data store factory a map that is there to cache
> the store resutls... imho that is a bad practice, still... the store
> is in unsupported
> so good thing it works some to start with.
>
> I think you can work around the issue by dodging the data store finder
> (which caches the factories) and creating a new wfs data store factory
> every time
>
> Cheers
> Andrea
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax:      +39 0584 962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Storage Efficiency Calculator
> This modeling tool is based on patent-pending intellectual property that
> has been used successfully in hundreds of IBM storage optimization engage-
> ments, worldwide.  Store less, Store more with what you own, Move data to
> the right place. Try It Now!
> http://www.accelacomm.com/jaw/sfnl/114/51427378/
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to