Package org.geotools.data

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


        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

                    } else {
                        writer.write();
                    }
                    task.setNumberProcessed(++cnt);
                }
                transaction.commit();
                if (skipped > 0) {
                    task.addMessage(Level.WARNING,skipped + " features were skipped.");
                }
                LOGGER.info("load to target took " + (System.currentTimeMillis() - startTime));
            }
View Full Code Here

                        try {
                            t.addAuthorization(fLock.getAuthorization());
                            DataStore dataStore = (DataStore) source.getDataStore();
                            dataStore.getLockingManager().refresh(fLock.getAuthorization(), t);
                        } finally {
                            t.commit();
                        }
                    } catch (IOException e) {
                        throw new WFSException(request, e);
                    } finally {
                        try {
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.