Package org.openrdf.sail

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


                    for (String key : e.getPropertyKeys()) {
                        System.out.println(key + "=" + e.getProperty(key));
                    }
                }
            } finally {
                sc.rollback();
                sc.close();
            }
        } finally {
            sail.shutDown();
        }
View Full Code Here


                sc.begin();
                assertEquals(0, sc.size());

                loader.load(f);

                sc.rollback();

                assertEquals(29, sc.size());
            } finally {
                sc.close();
            }
View Full Code Here

                        ModelCommons.add(triples,con.getStatements(resource,null,null,true,store.getValueFactory().createURI(cacheContext)));
                        ce.setTriples(triples);

                        con.commit();
                    } catch(SailException ex) {
                        con.rollback();
                    } finally {
                        con.close();
                    }
                }
                return ce;
View Full Code Here

                    entry.setResource(store.getValueFactory().createURI(resource.stringValue()));

                    dbcon.storeCacheEntry(entry);
                } catch(SailException ex) {
                    con.rollback();
                } finally {
                    con.close();
                }

            }
View Full Code Here

                    con.removeStatements(resource, null, null, store.getValueFactory().createURI(cacheContext));

                    con.commit();
                } catch(SailException ex) {
                    con.rollback();
                } finally {
                    con.close();
                }

            }
View Full Code Here

                    con.removeStatements((Resource) null, null, null, store.getValueFactory().createURI(cacheContext));

                    con.commit();
                } catch(SailException ex) {
                    con.rollback();
                } finally {
                    con.close();
                }

            }
View Full Code Here

        } catch(SailException | SQLException | ReasoningException ex) {
            log.error("REASONING ERROR: could not process rule, database state will be inconsistent! Message: {}",ex.getMessage());
            log.debug("Exception details:",ex);

            connection.rollback();
            sail.rollback();
            throw ex;
        } finally {
            connection.close();
            sail.close();
        }
View Full Code Here

            Assert.assertTrue(hasStatement(con, u1, p1, l1));
            Assert.assertFalse(hasStatement(con, u2, p2, l2));

            con.commit();
        } catch (final Throwable t) {
            con.rollback();
            throw t;
        } finally {
            con.close();
        }
    }
View Full Code Here

        try {
            con.begin();
            con.addStatement(u1, p2, l3);
            con.commit();
        } catch (final Throwable t) {
            con.rollback();
            throw t;
        } finally {
            con.close();
        }
        final SailConnection con2 = sail.getConnection();
View Full Code Here

            Assert.assertTrue(hasStatement(con2, u1, p2, l3, c1));
            Assert.assertFalse(hasStatement(con2, u1, p2, l3, c2));

            con2.commit();
        } catch (final Throwable t) {
            con2.rollback();
            throw t;
        } finally {
            con2.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.