In general we try and have a Transaction to keep seperate threads independent, but in this case we are both rendering from (and writing) to the same transaction.
I would not put any time into debugging this where you are at, The GeoTools 14.x series has been reviewed and approved by Eclipse IP process. This branch has migrated MemoryDataStore to ContendDataStore - so we are up against a new thing to test against. As part of the migration Torben was able to poke a few holes in the Diff data structure used to keep transactions independent. I would expect that would be the correct location to resolve any concurrent modification problems. -- Jody -- Jody Garnett On 7 September 2015 at 12:23, Frank Gasdorf <[email protected]> wrote: > Hi folks, > > Sorry for cross-posting, I'm unsure which forum is the right choise to > address this > > I'm wondering about the current behavior adding features programatically > to a layer. The layer has a MemoryGeoResourceImpl internally which uses > MemoryDataStore (geotools 11.2 & uDig 2.0.0-SNAPSHOT). > > I expected to get features stored to DataStore while uDig is (still) > rendering features already added. But the during rendering > ConcurrentModificatinExtepion's are thrown while writing new features or > modifying exiting. > > > !ENTRY org.locationtech.udig.project 2 0 2015-09-07 16:06:32.517 > !MESSAGE class java.util.ConcurrentModificationException occured during > rendering: null > !STACK 0 > org.locationtech.udig.project.render.RenderException: class > java.util.ConcurrentModificationException occured during rendering: null > at > org.locationtech.udig.render.internal.feature.basic.BasicFeatureRenderer.render(BasicFeatureRenderer.java:489) > at > org.locationtech.udig.render.internal.feature.basic.BasicFeatureRenderer.render(BasicFeatureRenderer.java:320) > at > org.locationtech.udig.project.internal.render.impl.RenderJob.startRendering(RenderJob.java:117) > at > org.locationtech.udig.project.internal.render.impl.RenderJob.run(RenderJob.java:222) > at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) > Caused by: java.util.ConcurrentModificationException > at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown Source) > at java.util.LinkedHashMap$ValueIterator.next(Unknown Source) > at > org.geotools.data.memory.MemoryDataStore.getBounds(MemoryDataStore.java:609) > at > org.geotools.data.AbstractFeatureSource.getBounds(AbstractFeatureSource.java:318) > at > org.geotools.data.AbstractFeatureSource.getBounds(AbstractFeatureSource.java:286) > at > org.locationtech.udig.catalog.memory.internal.MemoryGeoResourceImpl$ScratchResourceInfo.getBounds(MemoryGeoResourceImpl.java:167) > at > org.locationtech.udig.project.internal.impl.GeoResourceInfoInterceptor$Wrapper.getBounds(GeoResourceInfoInterceptor.java:63) > at > org.locationtech.udig.project.internal.impl.LayerImpl.obtainBoundsFromResources(LayerImpl.java:2173) > at > org.locationtech.udig.project.internal.impl.LayerImpl.getBounds(LayerImpl.java:2144) > at > org.locationtech.udig.render.internal.feature.basic.BasicFeatureRenderer.validateBounds(BasicFeatureRenderer.java:567) > at > org.locationtech.udig.render.internal.feature.basic.BasicFeatureRenderer.render(BasicFeatureRenderer.java:363) > ... 4 more > > From a "user" perspective its quite hard to synchchronize access to the > datastore while there are different extensions accessing the layer > (getBounds, Iterator for Renderer, etc.) and its resources from uDig. I > remember a discussion a few years ago about the same problem but cannot > find the thread anymore. > > Q: What's the best aproach to write features to MemoryDataStore while > other having read-access in between? Would it be a good approach using a > ConcurrentHashMap internally or using a different DataStore (e.g. h2)? > > Thanks in advance > > -- Frank > > _______________________________________________ > udig-dev mailing list > [email protected] > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://locationtech.org/mailman/listinfo/udig-dev >
------------------------------------------------------------------------------
_______________________________________________ GeoTools-Devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
