Package org.geotools.data

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


                    transaction.commit();
                    autoCommitReader = ds
                            .getFeatureReader(newFeatureQuery, Transaction.AUTO_COMMIT);
                    assertFalse(autoCommitReader.hasNext());
                } catch (Exception e) {
                    transaction.rollback();
                    throw e;
                }
            }
        } finally {
            transaction.close();
View Full Code Here


            // now commit
            transaction.commit();
            countNoTransaction = sourceNoTransaction.getCount(Query.ALL);
            assertEquals(5, countNoTransaction);
        } catch (Exception e) {
            transaction.rollback();
            throw e;
        } catch (AssertionFailedError e) {
            transaction.rollback();
            throw e;
        } finally {
View Full Code Here

            assertEquals(5, countNoTransaction);
        } catch (Exception e) {
            transaction.rollback();
            throw e;
        } catch (AssertionFailedError e) {
            transaction.rollback();
            throw e;
        } finally {
            transaction.close();
        }
    }
View Full Code Here

                    assertEquals(2, size);
                } catch (Throwable e) {
                    errors[0] = e;
                    try {
                        System.err.println("rolling back!.");
                        transaction.rollback();
                    } catch (IOException e1) {
                        e1.printStackTrace();
                    }
                } finally {
                    done[0] = true;
View Full Code Here

            count = store.getCount(Query.ALL);
            assertEquals(2, count);

            assertEquals(1, source.getCount(Query.ALL));
            transaction.rollback();
            assertEquals(1, store.getCount(Query.ALL));

            transaction.close();

            {
View Full Code Here

            sliceCat.computeAggregateFunction(q, cv);
            assertEquals(0, cv.getCount());

        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            t.rollback();
        } finally {
            if (sliceCat != null) {
                sliceCat.dispose();
            }
View Full Code Here

            // Get ImageIndexes
            List<Integer> indexes = reader.getImageIndex(q);
            assertNotNull(indexes);
            assertTrue(!indexes.isEmpty());
        } catch (Exception e) {
            t.rollback();
        } finally {
            if (sliceCat != null) {
                sliceCat.dispose();
            }
View Full Code Here

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

            try {
                featureStore.addFeatures(collection);
                transaction.commit();
            } catch (Exception problem) {
                problem.printStackTrace();
                transaction.rollback();
            } finally {
                transaction.close();
            }
            System.exit(0); // success!
        } else {
View Full Code Here

            }
            transaction.commit();
            JOptionPane.showMessageDialog(null, "Export to shapefile complete");
        } catch (Exception problem) {
            problem.printStackTrace();
            transaction.rollback();
            JOptionPane.showMessageDialog(null, "Export to shapefile failed");
        } finally {
            writer.close();
            iterator.close();
            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.