Package org.geotools.data

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


    while (reader.hasNext()) {
      reader.next();
      c++;
    }
    reader.close();
    transaction2.commit();
    transaction2.close();
    assertEquals(3, c);

    transaction2 = new DefaultTransaction();
    query = new Query("geostuff",
View Full Code Here


    while (reader.hasNext()) {
      reader.next();
      c++;
    }
    reader.close();
    transaction2.commit();
    transaction2.close();
    assertEquals(2, c);
  }

}
View Full Code Here

        transaction2);
    assertTrue(reader.hasNext());
    reader.next();
    assertFalse(reader.hasNext());
    reader.close();
    transaction2.commit();
    transaction2.close();

  }

  // ==============
View Full Code Here

        "geometry",
        factory.createPoint(new Coordinate(
            27.25,41.25)));
    writer.write();
    writer.close();
    transaction1.commit();
    transaction1.close();

    Transaction transaction2 = new DefaultTransaction();
    FeatureReader<SimpleFeatureType, SimpleFeature> reader = dataStore.getFeatureReader(
        query,
View Full Code Here

        query,
        transaction2);
    assertTrue(reader.hasNext());
    SimpleFeature priorFeature = reader.next();
    reader.close();
    transaction2.commit();
    transaction2.close();

    // Add one more in this transaction and remove the
    // prior feature.
View Full Code Here

    priorFeature = reader.next();
    assertFalse(reader.hasNext());
    assertTrue(priorFeature.getID().equals(
        idToRemove));
    reader.close();
    transaction2.commit();
    transaction2.close();

    // make sure existing transaction cannot see (not committed)
    reader = dataStore.getFeatureReader(
        query,
View Full Code Here

    priorFeature = reader.next();
    assertFalse(reader.hasNext());
    assertTrue(!priorFeature.getID().equals(
        idToRemove));
    reader.close();
    transaction2.commit();
    transaction2.close();
  }

  @Test
  public void testUpdate()
View Full Code Here

        "geometry",
        factory.createPoint(new Coordinate(
            27.25,41.25)));
    writer.write();
    writer.close();
    transaction1.commit();
    transaction1.close();

    // change the pid
    transaction1 = new DefaultTransaction();
    writer = dataStore.getFeatureWriter(
View Full Code Here

    assertFalse(reader.hasNext());
    assertTrue(!priorFeature.getAttribute(
        "pid").equals(
        pid));
    reader.close();
    transaction2.commit();
    transaction2.close();

    // commit change
    transaction1.commit();
    transaction1.close();
View Full Code Here

    assertFalse(reader.hasNext());
    assertTrue(priorFeature.getAttribute(
        "pid").equals(
        pid));
    reader.close();
    transaction2.commit();
    transaction2.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.