Package org.geotools.data

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


            // write things to disk
            ancillaryFileManager.writeToDisk();
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine("Committing changes to the DB");
            }
            transaction.commit();
        } catch (Throwable e) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine("Rollback");
            }
            if (transaction != null) {
View Full Code Here


        System.out.println("t1 commit auto-commit: "+DataUtilities.fidSet(featureStore.getFeatures()) );
        System.out.println("t1 commit          t1: "+DataUtilities.fidSet(featureStore1.getFeatures()) );
        System.out.println("t1 commit          t2: "+DataUtilities.fidSet(featureStore2.getFeatures()) );

        // commit transaction two
        t2.commit();

        System.out.println();
        System.out.println("Step 5 transaction 2 commits the addition of '"+feature.getID()+"'");
        System.out.println("------");
        System.out.println("t2 commit auto-commit: "+DataUtilities.fidSet(featureStore.getFeatures()) );
View Full Code Here

                }
            } 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

        assertEquals("client 1 after commiting removal of fid1 (client 2 has added fid5)", 4,
                roadFromClient1.getFeatures().size());
        assertEquals("client 2 after client 1 commits removal of fid1 (client 2 has added fid5)",
                5, roadFromClient2.getFeatures().size());

        transaction2.commit();
        assertEquals("auto after client 2 commits addition of fid5 (fid1 previously removed)", 5,
                roadAuto.getFeatures().size());
        assertEquals("client 1 after client 2 commits addition of fid5 (fid1 previously removed)",
                5, roadFromClient1.getFeatures().size());
        assertEquals("client 2 after commiting addition of fid5 (fid1 previously removed)", 5,
View Full Code Here

                Geometry geometry2 = JTS.transform(geometry, transform);

                copy.setDefaultGeometry(geometry2);
                writer.write();
            }
            transaction.commit();
            JOptionPane.showMessageDialog(null, "Export to shapefile complete");
        } catch (Exception problem) {
            problem.printStackTrace();
            transaction.rollback();
            JOptionPane.showMessageDialog(null, "Export to shapefile failed");
View Full Code Here

             */
            SimpleFeatureCollection collection = new ListFeatureCollection(TYPE, features);
            featureStore.setTransaction(transaction);
            try {
                featureStore.addFeatures(collection);
                transaction.commit();
            } catch (Exception problem) {
                problem.printStackTrace();
                transaction.rollback();
            } finally {
                transaction.close();
View Full Code Here

        SimpleFeatureStore featureStore;
        featureStore = (SimpleFeatureStore) newDataStore.getFeatureSource(typeName);
        featureStore.setTransaction(transaction);
        try {
            featureStore.addFeatures(featureCollection);
            transaction.commit();
            JOptionPane.showMessageDialog(null, "Export to shapefile complete", "Export",
                            JOptionPane.INFORMATION_MESSAGE);
        } catch (Exception problem) {
            transaction.rollback();
            problem.printStackTrace();
View Full Code Here

                if (writer != null) {
                    writer.close();
                    writer = null;
                }
            }
            t.commit();
            t.close();
            assertEquals(--idx, loadFeatures(sds).size());
        }
        sds.dispose();
    }
View Full Code Here

        newFeatures2[1].setDefaultGeometry(fac
                .createPoint(new Coordinate(0, 0)));

        store.addFeatures(DataUtilities.collection(newFeatures1));
        store.addFeatures(DataUtilities.collection(newFeatures2));
        transaction.commit();
        transaction.close();
        assertEquals(idx + 3, sds.getCount(Query.ALL));
        sds.dispose();

    }
View Full Code Here

                + DataUtilities.fidSet(featureStore1.getFeatures()));
        System.out.println("t1 commit          t2: "
                + DataUtilities.fidSet(featureStore2.getFeatures()));

        // commit transaction two
        t2.commit();

        System.out.println();
        System.out
                .println("Step 5 transaction 2 commits the addition of '" + feature.getID() + "'");
        System.out.println("------");
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.