Package org.geotools.data

Examples of org.geotools.data.Transaction.rollback()


  @Override
  protected void doRollback(DefaultTransactionStatus status) {
    GeoToolsTransactionObject txObject = (GeoToolsTransactionObject) status.getTransaction();
    Transaction tx = txObject.getTransactionHolder().getTransaction();
    try {
      tx.rollback();
    } catch (IOException e) {
      log.warn(e.getMessage(), e);
    }
  }
View Full Code Here


            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

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

        } catch (Exception problem) {
          problem.printStackTrace();
          transaction.rollback();

        } finally {
          transaction.close();
        }
        // success!
View Full Code Here

            try {
                targetStore.addFeatures(asFeatureCollection);
                transaction.commit();
            } catch (final Exception e) {
                if (transactional) {
                    transaction.rollback();
                }
                Throwables.propagateIfInstanceOf(e, GeoToolsOpException.class);
                throw new GeoToolsOpException(e, StatusCode.UNABLE_TO_ADD);
            } finally {
                transaction.close();
View Full Code Here

            try {
                targetStore.addFeatures(asFeatureCollection);
                transaction.commit();
            } catch (final Exception e) {
                if (transactional) {
                    transaction.rollback();
                }
                Throwables.propagateIfInstanceOf(e, GeoToolsOpException.class);
                throw new GeoToolsOpException(e, StatusCode.UNABLE_TO_ADD);
            } finally {
                transaction.close();
View Full Code Here

            tx.commit();

            assertEquals(3, dataStore.getFeatureSource(pointsTypeName).getFeatures().size());
        } catch (Exception e) {
            tx.rollback();
            throw e;
        } finally {
            tx.close();
        }
    }
View Full Code Here

            tx.commit();

            assertEquals(3, dataStore.getFeatureSource(pointsTypeName).getFeatures().size());
        } catch (Exception e) {
            tx.rollback();
            throw e;
        } finally {
            tx.close();
        }
    }
View Full Code Here

            tx.commit();

            assertEquals(3, dataStore.getFeatureSource(pointsTypeName).getFeatures().size());
        } catch (IllegalStateException e) {
            tx.rollback();
            gotIllegalStateException = true;
        } catch (Exception e) {
            tx.rollback();
            throw e;
        } finally {
View Full Code Here

            assertEquals(3, dataStore.getFeatureSource(pointsTypeName).getFeatures().size());
        } catch (IllegalStateException e) {
            tx.rollback();
            gotIllegalStateException = true;
        } catch (Exception e) {
            tx.rollback();
            throw e;
        } finally {
            tx.close();
        }
View Full Code Here

            assertEquals(1, points.getFeatures(ff.id(Collections.singleton(fid11))).size());
            assertEquals(1, points.getFeatures(ff.id(Collections.singleton(fid21))).size());
            assertEquals(1, points.getFeatures(ff.id(Collections.singleton(fid31))).size());

        } catch (Exception e) {
            tx.rollback();
            throw e;
        } finally {
            tx.close();
        }
    }
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.