Package org.geotools.data

Examples of org.geotools.data.DefaultTransaction.commit()


                SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;

                featureStore.setTransaction(transaction);
              
                featureStore.addFeatures(collection);
                transaction.commit();

                transaction.close();
            }
            else
            {
View Full Code Here


        Transaction transaction = new DefaultTransaction("create");
        try {
            FeatureStore<SimpleFeatureType, SimpleFeature> featureStore = (FeatureStore<SimpleFeatureType, SimpleFeature>) featureSource;
            featureStore.setTransaction(transaction);
            featureStore.addFeatures(collection);
            transaction.commit();
        } catch (Exception eek) {
            transaction.rollback();
            throw new IOException("The transaction could now be finished, an error orrcurred", eek);
        } finally {
            transaction.close();
View Full Code Here

                            warning = false;
                        }
                    }
                }
            }, progessListener );
            transaction.commit();
           
            // TODO: we need to show our new scratch feature in the catalog view?
            return scratch;
        }
        catch (RuntimeException huh){
View Full Code Here

                            warning = false;
                        }
                    }
                }
            }, progessListener );
            transaction.commit();
           
            // TODO: we need to show our new scratch feature in the catalog view?
            return scratch;
        }
        catch (RuntimeException huh){
View Full Code Here

                        try {
                            t.addAuthorization(response.getLockId());
                            DataStore dataStore = (DataStore) source.getDataStore();
                            dataStore.getLockingManager().refresh(response.getLockId(), t);
                        } finally {
                            t.commit();
                        }
                    } catch (IOException e) {
                        throw new WFSException(e);
                    } finally {
                        try {
View Full Code Here

        SimpleFeatureCollection collection = new ListFeatureCollection(
            features.get(0).getFeatureType(), features);
        featureStore.setTransaction(transaction);
        try {
          featureStore.addFeatures(collection);
          transaction.commit();

        } catch (Exception problem) {
          problem.printStackTrace();
          transaction.rollback();
View Full Code Here

                }
                SimpleFeatureCollection featureCollection = new ListFeatureCollection(srcSchema, sfcData);
                featureStoreData.addFeatures(featureCollection);
            }
           
            tx.commit();
            LOGGER.info("Copied " + i + " features for "+ layer+"/"+year+"/"+month+"/"+day+ " to " + dstPg);
            return i;

        } catch (Exception e) {
            quietRollbackTransaction(tx);
View Full Code Here

          LOGGER.debug("Filter: " + filter);

            // try to look for the destination table
            SimpleFeatureStore store = (SimpleFeatureStore) ds.getFeatureSource(layer);
            store.removeFeatures(filter);
            tx.commit();
        } catch (Exception e) {
            quietRollbackTransaction(tx);
            LOGGER.error("An exception was raised when deleting features from " + layer + "", e);
            throw new PostGisException("An exception was raised when deleting features from " + layer, e);
        } finally {
View Full Code Here

//               LOGGER.debug("Feature " + count + " - page: " + currentPage);
               // paging check
               if(count++>=ITEM_X_PAGE){
                 // commit to relief load from destination DB
                   featureStoreData.addFeatures(lfc);                      
                   tx.commit();
                   lfc.clear();
                   count=0;
//                   System.gc();
                   LOGGER.debug("Page" + currentPage++ + "/" + numPag + " committed... ");
View Full Code Here

            if(!lfc.isEmpty()){
            // commit to relief load from destination DB
              featureStoreData.addFeatures(lfc);
            
              // final commit
              tx.commit();   
            }
        } catch (Exception e) {
            quietRollbackTransaction(tx);
            LOGGER.error("An exception was raised when executing storing into the database");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.