Package org.openrdf.sail

Examples of org.openrdf.sail.SailConnection.rollback()


        sc = sail.getConnection();
        try {
            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(0, count);
            sc.rollback();
            sc.close();

            sc = sail.getConnection();
            sc.begin();
            sc.addStatement(uriA, uriB, uriC);
View Full Code Here


            sc = sail.getConnection();
            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(1, count);
            sc.rollback();
            sc.close();

            sc = sail.getConnection();
            sc.begin();
            sc.removeStatements(uriA, null, null);
View Full Code Here

            sc = sail.getConnection();
            sc.begin();
            count = countStatements(sc, uriA, null, null, false);
            assertEquals(0, count);
        } finally {
            sc.rollback();
            sc.close();
        }
    }

    /*
 
View Full Code Here

            Resource context = statement.getContext();
            assertNull(context);
            sc.removeStatements(uriA, null, null);
            sc.commit();
        } finally {
            sc.rollback();
            sc.close();
        }
    }

    // inference ////////////////////////////////////////////////////////////////
View Full Code Here

            long endTime = System.currentTimeMillis();

            LOGGER.info("loaded " + count + " statements in " + (endTime - startTime) + "ms");
        } finally {
            c.rollback();
            c.close();
        }
    }

    private long loadFile(final File fileOrDirectory,
View Full Code Here

            try {
                if (sc instanceof InferencerConnection) {
                    inferencer = new ForwardChainingRDFSInferencer((NotifyingSail) sail);
                }
            } finally {
                sc.rollback();
                sc.close();
            }
        }

        addFile(SailTest.class.getResourceAsStream("graph-example-sail-test.trig"), RDFFormat.TRIG);
View Full Code Here

            sc.begin();
            after = countStatements(sc, uriA, null, null, false);
            assertEquals(0, before);
            assertEquals(1, after);
        } finally {
            sc.rollback();
            sc.close();
        }
    }

    @Test
View Full Code Here

            sc.begin();
            after = countStatements(sc, uriA, uriB, null, false);
            assertEquals(0, before);
            assertEquals(1, after);
        } finally {
            sc.rollback();
            sc.close();
        }
    }

    @Test
View Full Code Here

            sc.begin();
            after = countStatements(sc, null, null, stringLitA, false);
            assertEquals(0, before);
            assertEquals(1, after);
        } finally {
            sc.rollback();
            sc.close();
        }
    }

    @Test
View Full Code Here

            assertEquals(0, before);
            assertEquals(1, after);
            assertEquals(foo, toSet(sc.getStatements(null, firstName, fooLabel, false)).iterator().next().getSubject());

        } finally {
            sc.rollback();
            sc.close();
        }
    }

    @Test
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.