Package org.geotools.data

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


        assertTrue(id.getIdentifiers().containsAll(newFids));
        // remember the FeatureId with a strong reference
        FeatureId tempFeatureId = (FeatureId) id.getIdentifiers().iterator().next();
        assertTrue(newFids.contains(tempFeatureId));

        t1.commit();
        assertEquals(1, listener.list.size());
        assertEquals(2, listener1.list.size());

        BatchFeatureEvent batch = (BatchFeatureEvent) listener1.list.get(2);
        assertFalse("confirm tempFid is not in the commit",
View Full Code Here


             * This one works regardless of the database being MSSQL or not because the table IS
             * being created as versioned by testData.createTestTable.
             * <http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=32190>
             */
            assertEquals(0, ds.getFeatureSource(tableName).getCount(Query.ALL));
            transaction.commit();
            writer.close();
            assertEquals(2, ds.getFeatureSource(tableName).getCount(Query.ALL));
        } finally {
            transaction.close();
        }
View Full Code Here

                 */
                assertEquals(2, ds.getFeatureSource(tableName).getCount(Query.ALL));
            } else {
                assertEquals(0, ds.getFeatureSource(tableName).getCount(Query.ALL));
            }
            transaction.commit();
            writer.close();
            assertEquals(2, ds.getFeatureSource(tableName).getCount(Query.ALL));
        } finally {
            transaction.close();
        }
View Full Code Here

        try {
            List<FeatureId> fids = testFeatureStore(tableName, transaction);
            assertEquals(1, fids.size());

            assertEquals(0, ds.getFeatureSource(tableName).getCount(Query.ALL));
            transaction.commit();
            assertEquals(1, ds.getFeatureSource(tableName).getCount(Query.ALL));
        } finally {
            transaction.close();
        }
    }
View Full Code Here

                 */
                assertEquals(1, ds.getFeatureSource(tableName).getCount(Query.ALL));
            } else {
                assertEquals(0, ds.getFeatureSource(tableName).getCount(Query.ALL));
            }
            transaction.commit();
            assertEquals(1, ds.getFeatureSource(tableName).getCount(Query.ALL));
        } finally {
            transaction.close();
        }
    }
View Full Code Here

            } else {
                assertFalse("Features added, transaction not commited", hasNext);
            }

            try {
                transaction.commit();
            } catch (Exception e) {
                transaction.rollback();
                throw e;
            }
        } finally {
View Full Code Here

            final Id newFidsFilter = ff.id(fids);

            SimpleFeatureCollection features;
            features = fStore.getFeatures(newFidsFilter);
            assertEquals(2, features.size());
            transaction.commit();
        } catch (Exception e) {
            transaction.rollback();
            throw e;
        } finally {
            transaction.close();
View Full Code Here

            } finally {
                reader.close();
            }

            try {
                transaction.commit();
            } catch (IOException e) {
                transaction.rollback();
                throw e;
            }
        } finally {
View Full Code Here

            try {
                final AttributeDescriptor propDescriptor = schema.getDescriptor("INT32_COL");
                store.modifyFeatures(propDescriptor.getName(), Integer.valueOf(-1000),
                        oldValueFilter);
                transaction.commit();
            } catch (Exception e) {
                transaction.rollback();
            } finally {
                transaction.close();
            }
View Full Code Here

        Filter fid1Filter = ff.id(Collections.singleton(ff.featureId(fid1)));
        Filter fid2Filter = ff.id(Collections.singleton(ff.featureId(fid2)));
        try {
            store.modifyFeatures(defaultGeometry.getName(), modif2, fid2Filter);
            store.modifyFeatures(defaultGeometry.getName(), modif1, fid1Filter);
            transaction.commit();
        } catch (Exception e) {
            transaction.rollback();
            throw e;
        } finally {
            transaction.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.