Package org.geotools.data

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


                }
            } finally {
                writer.close();
            }
            System.out.println("commit " + t); // now the contents are removed
            t.commit();
        } catch (Throwable eek) {
            t.rollback();
        } finally {
            t.close();
            store.dispose();
View Full Code Here


        fr.close();
        assertEquals(count1+insert.size(), count2);

       
      System.out.println("Insert Commit");
      t.commit();

      System.out.println("Insert Read 3");
      fr = fs.getFeatures().features();
      int count3 = 0;
      while(fr.hasNext()){
View Full Code Here

      }
        fr.close();
      assertTrue("Read 1 == "+count1+" Read 2 == "+count2,count2<count1);

      System.out.println("Delete Commit");
      t.commit();

      System.out.println("Delete Read 3");
      fr = fs.getFeatures().features();
      int count3 = 0;
      while(fr.hasNext()){
View Full Code Here

//System.out.println("Read 1 == "+count1+" Read 2 == "+count2);
      assertTrue("Read 1 == "+count1+" Read 2 == "+count2,count2>count1);

      System.out.println("Update Commit");
        try {
            t.commit();

            assertTrue(((WFSTransactionState) t.getState(ds)).getFids(ft.getTypeName()) != null);

            System.out.println("Update Read 3");
            fr = fs.getFeatures(f).features();
View Full Code Here

            fr.close();
            assertEquals(count2, count3);
        } finally {
            // cleanup
            fs.modifyFeatures(at, oldValue, Filter.INCLUDE);
            t.commit();
        }
    }
}
View Full Code Here

        store.removeFeatures(filterRemove);
       
        Filter filterUpdate = filterfac.id(filterfac.featureId("poi.3"));       
        store.modifyFeatures("NAME", "blah", filterUpdate);
               
        transaction.commit();
       
        ContentFeatureCollection coll = store.getFeatures();
        FeatureIterator it= coll.features();
        while (it.hasNext()) {
            System.err.println(it.next());
View Full Code Here

        assertTrue(coversLax(reader, 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)
        reader = data.getFeatureReader(allRoadsQuery, Transaction.AUTO_COMMIT);
        reader = data.getFeatureReader(allRoadsQuery, Transaction.AUTO_COMMIT);
        assertTrue(coversLax(reader, FINAL));
View Full Code Here

        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

                    g.setAttribute(name, f.getAttribute(name));
                }
                                            
                w.write();
            }
            tx.commit();
        }
        catch(Exception ex) {
            tx.rollback();
            throw new IOException(ex);
        }
View Full Code Here

        FeatureWriter<SimpleFeatureType, SimpleFeature> writer = dataStore.getFeatureWriterAppend(tname("ft1"), tx);
        SimpleFeature feature = writer.next();
        feature.setAttribute(aname("intProperty"), new Integer(100));
        writer.write();
        writer.close();
        tx.commit();
        tx.close();

        SimpleFeatureCollection fc = dataStore.getFeatureSource(tname("ft1")).getFeatures();
        assertEquals(4, fc.size());
    }
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.