Package org.openrdf.sail

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


                 
                  c.commit();
 
                  _logger.info("Read " + handler.m_count + " statements from '" + sourceURL + "'");
              } catch (RepositoryException e) {
                  if (c != null) c.rollback();
              } finally {
                  if (c != null) c.close();
              }
          } catch (Exception e) {
              throw new ModelReadFromFileException("Failed to read data from '" + sourceURL + "'", e);
View Full Code Here


                }
                rdfParser.setRDFHandler(h);
                rdfParser.parse(input, baseURI);
                c.commit();
            } finally {
                c.rollback();
                c.close();
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

                    iter.close();
                }

                w.endRDF();
            } finally {
                c.rollback();
                c.close();
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    }

    public void rollback() {
        try {
            SailConnection sc = this.sailConnection.get();
            sc.rollback();
            sc.begin();
        } catch (SailException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
View Full Code Here

                    //sc.removeStatements(uriA, RDF.TYPE, classX);
                    //sc.commit();
                    //assertEquals(1, countStatements(sc, uriA, RDF.TYPE, null));
                }
            } finally {
                sc.rollback();
                sc.close();
            }
        }
    }
View Full Code Here

        try {
            sc.begin();
            sc.clear();
            sc.commit();
        } finally {
            sc.rollback();
            sc.close();
        }
    }

    protected void addFile(final InputStream in,
View Full Code Here

                RDFParser p = Rio.createParser(format);
                p.setRDFHandler(h);
                p.parse(in, "http://example.org/bogusBaseURI/");
                sc.commit();
            } finally {
                sc.rollback();
                sc.close();
            }
        } finally {
            in.close();
        }
View Full Code Here

            sc.addStatement(uriD, uriB, uriA, uriC);
            assertEquals(3, countStatements(sc, null, null, null, false));
            assertEquals(1, count(sc.getContextIDs()));
        } finally {
            sc.rollback();
            sc.close();
        }
    }

    @Test
View Full Code Here

            assertEquals(4L, sc.size(uriA, uriB, null));
            assertEquals(4L, sc.size(uriA, uriB, uriC, null));
            assertEquals(3L, sc.size(uriA, uriB));
            sc.commit();
        } finally {
            sc.rollback();
            sc.close();
        }
    }

    @Test
View Full Code Here

                sc.addStatement(uriA, uriB, uriC, uriC);
                assertEquals(2, countStatements(sc, uriA, uriB, uriC, false));
                assertEquals(1, countStatements(sc, uriA, uriB, uriC, false, uriC));
                sc.commit();
            } finally {
                sc.rollback();
                sc.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.