Package org.geotools.data

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


        assertTrue(coversLax(road2.getFeatures().features(), FINAL));

        // commit t2
        // ---------
        // -ensure that everyone is FINAL at the end of the day
        t2.commit();

        // We now have Number( remove one and add one)
        assertTrue(coversLax(road.getFeatures().features(), FINAL));
        assertTrue(coversLax(road1.getFeatures().features(), FINAL));
        assertTrue(coversLax(road2.getFeatures().features(), FINAL));
View Full Code Here


        transaction1.commit();
        assertEquals( "auto after client 1 commits removal of fid1 (client 2 has added fid5)", 4, roadAuto.getFeatures().size() );
        assertEquals( "client 1 after commiting removal of fid1 (client 2 has added fid5)", 4, roadFromClient1.getFeatures().size() );
        assertEquals( "client 2 after client 1 commits removal of fid1 (client 2 has added fid5)", 5, roadFromClient2.getFeatures().size() );               
           
        transaction2.commit();
        assertEquals( "auto after client 2 commits addition of fid5 (fid1 previously removed)", 5, roadAuto.getFeatures().size() );
        assertEquals( "client 1 after client 2 commits addition of fid5 (fid1 previously removed)", 5, roadFromClient1.getFeatures().size() );
        assertEquals( "client 2 after commiting addition of fid5 (fid1 previously removed)", 5, roadFromClient2.getFeatures().size() );
    }
   
View Full Code Here

        reader.close();

        // commit t2
        // ---------
        // -ensure that everyone is FINAL at the end of the day
        t2.commit();

        // We now have Number( remove one and add one)
        reader = dataStore.getFeatureReader(new DefaultQuery(tname("road"), Filter.INCLUDE),
                Transaction.AUTO_COMMIT);
        assertTrue(coversLax(reader, FINAL));
View Full Code Here

                double y = p.getY();
                assertEquals(10D, x, 1E-5);
                assertEquals(10D, y, 1E-5);
            }

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

            content[0] = "Feature name 2";
            content[1] = reader.read("POINT (2 2)");
            feature = SimpleFeatureBuilder.build(schema, content, (String) null);
View Full Code Here

        // /assertEquals(2, store2.getCount(Query.ALL));
        assertEquals(1, store2.getCount(Query.ALL));

        // commit t2, overrides the state commited by t1
        transaction2.commit();
        assertEquals(1, store1.getCount(Query.ALL));
        assertEquals(1, store2.getCount(Query.ALL));
    }

}
View Full Code Here

          writer.next();

        SimpleFeature feature = writer.next();
        feature.setAttributes(newFeature2.getAttributes());
        writer.write();
        t.commit();
      } finally {
        t.close();
      }
      //cacheFS.resetDidRead();
      assertEquals(numFeatures+1, cacheDataset.getFeatures().size());
View Full Code Here

            SimpleFeature f = SimpleFeatureBuilder.build(hft, new Object[] { tableName,
                    newLocalRevision, newCentralRevision }, null);
            history.addFeatures(DataUtilities.collection(f));

            // commit all the changes
            transaction.commit();

            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
View Full Code Here

                .featureId("restricted.d91fe390-bdc7-4b22-9316-2cd6c8737ef5")));
        Transaction t = new DefaultTransaction();
        restricted.setTransaction(t);
        restricted.removeFeatures(removeFilter);
        String v1 = restricted.getVersion();
        t.commit();

        // revert
        String v2 = restricted.getVersion();
        restricted.rollback("FIRST", null, null);
        t.commit();
View Full Code Here

        t.commit();

        // revert
        String v2 = restricted.getVersion();
        restricted.rollback("FIRST", null, null);
        t.commit();
        t.close();
       
        restricted.setTransaction(Transaction.AUTO_COMMIT);

        // grab the two readers, separate
View Full Code Here

                .featureId("restricted.be7cafea-d0b7-4257-9b9c-1ed3de3f7ef4")));
        Transaction t = new DefaultTransaction();
        restricted.setTransaction(t);
        restricted.modifyFeatures(schema.getDescriptor("cat"), -48, updateFilter);
        String v1 = restricted.getVersion();
        t.commit();
       
        // second update
        WKTReader wkt = new WKTReader();
        Geometry g = wkt.read("MULTIPOLYGON(((0 0, 0 10, 10 10, 10 0, 0 0)))");
        restricted.modifyFeatures(schema.getDescriptor("the_geom"), g, updateFilter);
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.