I am not sure Niels, we do have some tricky logic around source vs entry,
but I expect you are on to something.

The test case to write (to confirm this) involves two transactions:
a) One transaction issuing a bulk event, such as commit
b) A second transaction, which should get this commit notification sent to
its listeners

The other case is transaction auto commit:
a) event sent on transaction auto commit, such as feature add
b) a second transaction, which should get this feature add event
notification

Jody


Jody Garnett


On Wed, May 7, 2014 at 7:15 AM, Niels Charlier <[email protected]> wrote:

>  Hi Everyone,
>
> while working on wfs-ng, I think I found a bug in the events system in
> gt-data.
> This is my suggested change:
>
> https://github.com/NielsCharlier/geotools/commit/af9df3e282d0ad70fbf463fa5e2b36225a53116a
>
> In 
> modules/library/data/src/main/java/org/geotools/data/store/ContentEntry.java
> , now it is:
>
> for(ContentState entry : state.values() ){
>            if( entry == source ) {
>                 continue; // no notificaiton required
>             }
>             for( FeatureListener listener : source.listeners ){
>                 try {
>                     listener.changed( notification );
>                 }
>                 catch (Throwable t ){
>                     // problem issuing notification to an interested party
>                     dataStore.LOGGER.log( Level.WARNING, "Problem issuing
> feature event "+notification, t );
>                 }
>             }
>          }
>
> I would assume it should be this:
>
>    for(ContentState entry : state.values() ){
>            if( entry == source ) {
>                continue; // no notificaiton required
>            }
>            for( FeatureListener listener : *entry*.listeners ){
>                try {
>                    listener.changed( notification );
>                }
>                catch (Throwable t ){
>                    // problem issuing notification to an interested party
>                    dataStore.LOGGER.log( Level.WARNING, "Problem issuing
> feature event "+notification, t );
>                }
>            }
>         }
>
>
>  Why loop over the entries otherwise? It seems to me my change makes more
> sense.
>
> Kind Regards
> Niels
>
>
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> &#149; 3 signs your SCM is hindering your productivity
> &#149; Requirements for releasing software faster
> &#149; Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> _______________________________________________
> GeoTools-Devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
>
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to