Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Status of 1.2.1 - commit / rollback / edit fun

Okay; debugging shows that this UDIGFeatureStore code is not getting called.

Going a bit further; the interceptors are not engaging - why?

Looks like we are getting tripped up on the difference between SimpleFeatureStore and FeatureStore<SimpleFeatureType,SimpleFeature>.

So I expect a couple hours of fiddling with class lookup in order to sort this one out; at least we know where the problem is.
I will focus on getting shapefile to work first; and then may need a hand to perform the same steps on the other implementations.

Cheers,
Jody

On 17/12/2010, at 1:31 PM, Jody Garnett wrote:

So I tried the same tests and others; and the edit tools are currently working in Transaction.AUTO_COMMIT mode. Since that does not fire the same events as normal the screen is not being refreshed.

I did a code review of UDIGFeatureStore and made sure to get all the method signatures correct.

I also paid special attention to the following method:

    private void setTransactionInternal() {
        if (!layer.isApplicable(ProjectBlackboardConstants.LAYER__EDIT_APPLICABILITY)) {
            String message = "Attempted to open a transaction on a non-editable layer (Aborted)";
            IllegalStateException illegalStateException = new IllegalStateException( message );
            ProjectPlugin.log(message, illegalStateException);
            throw illegalStateException;
        }
        // grab the current map transaction
        EditManager editManager = (EditManager) layer.getMap().getEditManager();
        Transaction transaction = editManager.getTransaction();
        
        if (wrapped.getTransaction() == Transaction.AUTO_COMMIT) {
            // change over from autocommit to transactional
            wrapped.setTransaction(transaction);
        }
        else if (wrapped.getTransaction() != transaction){
            // a transaction is already present? huh ...
            String msg = "Layer transaction already set "+wrapped.getTransaction(); //$NON-NLS-1$
            IllegalStateException illegalStateException = new IllegalStateException(msg);
            ProjectPlugin.log(msg,illegalStateException);
            throw illegalStateException;
        }
    }

The serious differences are (code review welcome):
- checking that the transaction is actually the current map transaction
- And then throwing a fit (well an IllegalStateException) rather than just logging the problem

I am going to stick some break points in and resume testing; after lunch.

Jody


Back to the top