Package org.geotools.data

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


                 */
                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

                source = fi.next();
                dest = writer.next();
                dest.setAttributes(source.getAttributes());
                writer.write();
            }
            transaction.commit();
        } catch (Exception e) {
            transaction.rollback();
            throw e;
        } finally {
            writer.close();
View Full Code Here

            }

            // now commit, and Transaction.AUTO_COMMIT should carry it over
            // do not close the transaction, we'll keep using it
            try {
                transaction.commit();
            } catch (IOException e) {
                transaction.rollback();
                throw e;
            }
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.