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

Reply via email to