Testing this, it looks like the requisite events are handled through
DiffTransactionState, which causes ContentState to fire events on commit()
etc.
This is backed up by the fact that the
ContentFeatureSourceEventsTest.testFeatureEventsWithTransaction test failed
with extra events when this change was made.
So I don't think we need to pull events out of the braces, just locking.
Torben
On Tue, Jan 6, 2015 at 11:55 AM, Jody Garnett <[email protected]>
wrote:
> Found an interesting glitch reviewing ContentFeatureStore that resolves
> one of my long standing difficulties integrating uDig with modern versions
> of GeoTools (I was always having trouble with events).
>
> Turns out due to a brace being in the wrong spot that rappers for events
> and locking were not being applied.
>
> if (!canTransact() && transaction != null && transaction !=
> Transaction.AUTO_COMMIT) {
> ...
> writer = new DiffContentFeatureWriter(this, state.getDiff(),
> reader);
> } else {
> writer = getWriterInternal(query, flags);
> if (!canEvent()){
> writer = new EventContentFeatureWriter(this, writer );
> }
> if (!canFilter()) {
> ..
> }
> if (!canLock()) {
> ...
> }
> }
>
> The DiffContentFeatureWriter is not responsible for events and locking, so
> the code should be:
>
> if (!canTransact() && transaction != null && transaction !=
> Transaction.AUTO_COMMIT) {
> ...
> writer = new DiffContentFeatureWriter(this, state.getDiff(),
> reader);
> } else {
> writer = getWriterInternal(query, flags);
> if (!canFilter()) {
> ..
> }
> }
> if (!canEvent()){
> writer = new EventContentFeatureWriter(this, writer );
> }
> if (!canLock()) {
> ...
> }
> }
>
> Good times.
> --
> Jody Garnett
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> GeoTools-Devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel