Revision 39690 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/paging/impl/FeaturePagingHelperImpl.java

View differences:

FeaturePagingHelperImpl.java
241 241
    private FeatureSet getFeatureSet(boolean reset) {
242 242
        
243 243
        if (featSet == null || reset) {
244
            
245
            if (featSet != null) {
246
                try {
247
                    featSet.dispose();
248
                } catch (Exception ex) {
249
                    LOG.info("Error while disposing featset.", ex);
250
                }
251
            }
252
            
244 253
            try {
245 254
                FeatureStore featureStore = getFeatureStore();          
246 255
                synchronized (featureStore) {
......
259 268

  
260 269
    public void reloadCurrentPage() throws BaseException {
261 270
        
262
        /*
263
         * Force re-creation of feature set
264
         */
265
        this.getFeatureSet(true);
266
        
267 271
        setSelectionUp(false);
268 272
        if (getCalculator().getCurrentPage() > -1) {
269 273
            loadCurrentPageData();
......
271 275
    }
272 276

  
273 277
    public void reload() throws BaseException {
278
        
279
        /*
280
         * Force re-creation of feature set
281
         */
282
        this.getFeatureSet(true);
283

  
284
        
274 285
        setDefaultCalculator(new Sizeable() {
275 286
            public long getSize() {
276
            	FeatureSet featureSet = getFeatureSet(true);
287
            	FeatureSet featureSet = getFeatureSet(false);
277 288
                try {
278 289
					return featureSet.getSize();
279 290
                } catch (BaseException e) {
......
427 438

  
428 439
    public void delete(Feature feature) throws BaseException {
429 440
        featureStore.delete(feature);
441
        /*
442
         * Force re-creation of feature set
443
         */
444
        this.getFeatureSet(true);
445

  
430 446
        reloadCurrentPage();
431 447
    }
432 448

  
433 449
    public void insert(EditableFeature feature) throws BaseException {
434 450
    	featureStore.insert(feature);
451
        /*
452
         * Force re-creation of feature set
453
         */
454
        this.getFeatureSet(true);
455

  
435 456
        reloadCurrentPage();
436 457
    }
437 458

  
438 459
    public void update(EditableFeature feature) throws BaseException {
439 460
    	featureStore.update(feature);
461
        /*
462
         * Force re-creation of feature set
463
         */
464
        this.getFeatureSet(true);
465

  
440 466
        reloadCurrentPage();
441 467
    }
442 468

  
......
467 493

  
468 494
    protected void doDispose() throws BaseException {
469 495
        initialSelection.dispose();
496
        if (featSet != null) {
497
            try {
498
                featSet.dispose();
499
            } catch (Exception ex) {
500
                LOG.info("Error while disposing featset.", ex);
501
            }
502
        }
470 503
    }
471 504

  
472 505
    public DynObject[] getCurrentPageDynObjects() {

Also available in: Unified diff