While this method appears clearer, it does not actually resolve any of the
test failures I am seeing on gs-wfs. Going over you code, I found an issue:

In DiffTransactionState, when you request the store, you never set a
transaction:
136:    store = (ContentFeatureStore) dataStore.getFeatureSource(name);

Therefore, the store (and the writer) use the autocommit transacition, and
your flag is ignored by ContentFeatureStore:
146:    if (!canTransact() && transaction != null && transaction !=
Transaction.AUTO_COMMIT) {

I will test again after fixing this.

Torben

On Tue, Jan 6, 2015 at 6:21 PM, Jody Garnett <[email protected]> wrote:

> You are indeed correct, DiffTransactionState also takes responsibility for
> firing events.
>
> I experimented with pulling out just the locking, and introducing a
> "commit writer" flag for COMMIT as a way for DiffTransactionState.commit()
> to avoid wrappers.  The result is here:
> https://github.com/jodygarnett/geotools/tree/commit_flag if you would
> like to look.
>
> Jody
>
>
>
> --
> Jody Garnett
>
> On 6 January 2015 at 12:35, Torben Barsballe <[email protected]>
> wrote:
>
>> 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

Reply via email to