Package org.openrdf.repository

Examples of org.openrdf.repository.RepositoryConnection.rollback()


                final Facading f3 = FacadingFactory.createFacading(fc3);
                Assert.assertEquals(v, f3.createFacade(subject, FooFacade.class).getString());

                fc3.commit();
            } finally {
                if (fc3.isActive()) fc3.rollback();
                fc3.close();
            }
        } finally {
            if (fc.isActive()) fc.rollback();
            fc.close();
View Full Code Here


                    final TypeFacade tf_1 = f_1.createFacade(subject, TypeFacade.class);
                    Assert.assertNull(tf_1.getTitle());
                    Assert.assertTrue(f_1.isFacadeable(subject, TypeFacade.class));
                    Assert.assertTrue(ResourceUtils.hasType(subCon_1, subject, TypeFacade.TYPE));

                    subCon_1.rollback();
                } finally {
                    if (subCon_1.isActive()) subCon_1.rollback();
                    subCon_1.close();
                }
            }
View Full Code Here

                    Assert.assertTrue(f_1.isFacadeable(subject, TypeFacade.class));
                    Assert.assertTrue(ResourceUtils.hasType(subCon_1, subject, TypeFacade.TYPE));

                    subCon_1.rollback();
                } finally {
                    if (subCon_1.isActive()) subCon_1.rollback();
                    subCon_1.close();
                }
            }

            mainCon.commit();
View Full Code Here

                    Assert.assertTrue(ResourceUtils.hasType(subCon_2, subject, TypeFacade.TYPE));
                    Assert.assertTrue(f_2.isFacadeable(subject, TypeFacade.class));

                    subCon_2.commit();
                } finally {
                    if (subCon_2.isActive()) subCon_2.rollback();
                    subCon_2.close();
                }
            }
        } catch (ConcurrentModificationException ex) {
            // do nothing, H2 locking
View Full Code Here

                        } else if (sparqlQuery instanceof BooleanQuery) {
                            query((BooleanQuery) sparqlQuery, booleanWriter);
                        } else if (sparqlQuery instanceof GraphQuery) {
                            query((GraphQuery) sparqlQuery, graphWriter.getOutputStream(), graphWriter.getFormat());
                        } else {
                            connection.rollback();
                            throw new InvalidArgumentException("SPARQL query type " + sparqlQuery.getClass() + " not supported!");
                        }

                        connection.commit();
                    } catch (Exception ex) {
View Full Code Here

                            throw new InvalidArgumentException("SPARQL query type " + sparqlQuery.getClass() + " not supported!");
                        }

                        connection.commit();
                    } catch (Exception ex) {
                        connection.rollback();
                        throw ex;
                    } finally {
                        connection.close();
                    }
                } catch(RepositoryException e) {
View Full Code Here

                        } else if (sparqlQuery instanceof BooleanQuery) {
                            query((BooleanQuery) sparqlQuery, (BooleanQueryResultWriter)writer);
                        } else if (sparqlQuery instanceof GraphQuery) {
                            query((GraphQuery) sparqlQuery, ((SPARQLGraphResultWriter)writer).getOutputStream(), ((SPARQLGraphResultWriter)writer).getFormat());
                        } else {
                            connection.rollback();
                            throw new InvalidArgumentException("SPARQL query type " + sparqlQuery.getClass() + " not supported!");
                        }

                        connection.commit();
                    } catch (Exception ex) {
View Full Code Here

                            throw new InvalidArgumentException("SPARQL query type " + sparqlQuery.getClass() + " not supported!");
                        }

                        connection.commit();
                    } catch (Exception ex) {
                        connection.rollback();
                        throw ex;
                    } finally {
                        connection.close();
                    }
                } catch(RepositoryException e) {
View Full Code Here

                            throw new InvalidArgumentException("SPARQL query type " + sparqlQuery.getClass() + " not supported!");
                        }

                        connection.commit();
                    } catch (Exception ex) {
                        connection.rollback();
                        throw ex;
                    } finally {
                        connection.close();
                    }
                } catch(RepositoryException e) {
View Full Code Here

                connection.begin();
                Update update = connection.prepareUpdate(queryLanguage,query,configurationService.getBaseUri());
                update.execute();
                connection.commit();
            } catch (UpdateExecutionException e) {
                connection.rollback();
                throw new MarmottaException("error while executing update",e);
            } catch (MalformedQueryException e) {
                connection.rollback();
                throw new MarmottaException("malformed query, update failed",e);
            } finally {
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.