Package org.geotools.data

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


        reader = dataStore.getFeatureReader(new DefaultQuery(tname("road"), td.rd1Filter), t);
        assertEquals(0, count(reader));
        reader.close();

        t.rollback();
        reader = dataStore.getFeatureReader(new DefaultQuery(tname("road"), Filter.EXCLUDE), t);
        assertEquals(0, count(reader));
        reader.close();

        reader = dataStore.getFeatureReader(new DefaultQuery(tname("road"), Filter.INCLUDE), t);
View Full Code Here


        t1.rollback(); // don't save
        writer1.close();
        t1.close();

        t2.rollback();
        writer2.close();
        t2.close();
    }

    // Feature Source Testing
View Full Code Here

        assertEquals(roadFeatures.length - 1, count(reader));

        reader = data.getFeatureReader(new DefaultQuery("road", rd1Filter), t);
        assertEquals(0, count(reader));

        t.rollback();
        reader = data.getFeatureReader(new DefaultQuery("road", Filter.EXCLUDE), t);
        assertEquals(0, count(reader));

        reader = data.getFeatureReader(new DefaultQuery("road"), t);
        assertEquals(roadFeatures.length, count(reader));
View Full Code Here

            count = store.getCount(Query.ALL);
            assertEquals(2, count);

            assertEquals(1, source.getCount(Query.ALL));
            transaction.rollback();
            assertEquals(1, store.getCount(Query.ALL));

            transaction.close();

            {
View Full Code Here

            LOGGER.info(core.countChanges(changes)
                    + " changes coming from Central succesfully applied");
        } catch (Throwable t) {
            // make sure we rollback the transaction in case of _any_ exception
            try {
                transaction.rollback();
            } catch (IOException e) {
                LOGGER.log(Level.SEVERE, "Rollback failed. This is unexpected", e);
            }

            if (t instanceof GSSException) {
View Full Code Here

                // all sub exceptions in this catch block should be logged, not thrown
                // as the triggering exception will be thrown
   
                //failure, rollback transaction
                try {
                    transaction.rollback();
                } catch (Exception e1) {
                    LOGGER.log(Level.WARNING, "Error rolling back transaction",e1);
                }
   
                //attempt to drop the type that was created as well
View Full Code Here

                        featureStore.addFeatures(features);
                       
                        tx.commit();
                    }
                    catch(Exception e) {
                        tx.rollback();
                    }
                    finally {
                        tx.close();
                    }
                }
View Full Code Here

            LOGGER.info(core.countChanges(changes)
                    + " changes coming from Central succesfully applied");
        } catch (Throwable t) {
            // make sure we rollback the transaction in case of _any_ exception
            try {
                transaction.rollback();
            } catch (IOException e) {
                LOGGER.log(Level.SEVERE, "Rollback failed. This is unexpected", e);
            }

            if (t instanceof GSSException) {
View Full Code Here

                        featureStore.addFeatures(features);
                       
                        tx.commit();
                    }
                    catch(Exception e) {
                        tx.rollback();
                    }
                    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.