@Override public void shutdown() { try { cxn.close(); } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void shutdown() { try { cxn.close(); } catch (Exception ex) { log.warn("Error closing connection: " + ex); } }
public void close() { // Close the TupleQueryResult. super.close(); try { // Close the connection. cxn.close(); } catch (RepositoryException e) { throw new RuntimeException(e); } } };
@Override public void rollback() { try { cxn.rollback(); cxn.close(); } catch (Exception e) { throw new RuntimeException(e); } }
public void close() { // Close the TupleQueryResult. super.close(); try { // Close the connection. cxn.close(); } catch (RepositoryException e) { throw new RuntimeException(e); } } };
public void close() { // Close the TupleQueryResult. super.close(); try { // Close the connection. cxn.close(); } catch (RepositoryException e) { throw new RuntimeException(e); } } };
public void close() { // Close the TupleQueryResult. super.close(); try { // Close the connection. cxn.close(); } catch (RepositoryException e) { throw new RuntimeException(e); } } };
@Override public Void call() throws Exception { BigdataSailRepositoryConnection conn = null; try { conn = getQueryConnection(indexManager, namespace, ITx.READ_COMMITTED); if (conn != null) { discovered.set(true); } } catch(Throwable t) { errorCount.incrementAndGet(); log.error(t); // Added delegate to trace to see which proxy version of this test fails in CI. throw new RuntimeException("delegate="+getOurDelegate()+", t=" + t, t); } finally { if (conn != null) { conn.close(); } } return null; }
/** * Verify that the named kb does not exist. * * @throws SailException */ private void assertKBNotFound(final Journal jnl, final String namespace) throws RepositoryException, SailException { // Attempt to discover the KB instance. BigdataSailRepositoryConnection conn = null; try { // Request query connection. conn = getQueryConnection(jnl, namespace, ITx.READ_COMMITTED); // Verify KB does not exist. assertNull(namespace, conn); } finally { // Ensure connection is closed. if (conn != null) conn.close(); } }
@Override public Void call() throws Exception { final long begin = System.currentTimeMillis(); BigdataSailRepositoryConnection conn = null; try { conn = getQueryConnection(); // Note: We have to align Sail semantics for Resource... with the // REST API. final boolean found = conn.hasStatement(s, p, o, includeInferred, c == null ? new Resource[0] : c); final long elapsed = System.currentTimeMillis() - begin; buildAndCommitBooleanResponse(resp, found, elapsed); return null; } finally { if (conn != null) { conn.close(); } } }
/** * Verify that the named kb exists. * * @throws SailException */ private void assertKBExists(final Journal jnl, final String namespace) throws RepositoryException, SailException { // Attempt to discover the KB instance. BigdataSailRepositoryConnection conn = null; try { // Request query connection. conn = getQueryConnection(jnl, namespace, ITx.READ_COMMITTED); // Verify KB exists. assertNotNull(namespace, conn); } finally { // Ensure connection is closed. if (conn != null) conn.close(); } }
@Override public Void call() throws Exception { final long begin = System.currentTimeMillis(); BigdataSailRepositoryConnection conn = null; try { conn = getQueryConnection(); // Note: We have to align Sail semantics for Resource... with the // REST API. final boolean found = conn.hasStatement(s, p, o, includeInferred, c == null ? new Resource[0] : c); final long elapsed = System.currentTimeMillis() - begin; buildAndCommitBooleanResponse(resp, found, elapsed); return null; } finally { if (conn != null) { conn.close(); } } }
private void executeUpdate(final BigdataSailRepository repo, final String update) throws UpdateExecutionException, RepositoryException, MalformedQueryException { final BigdataSailRepositoryConnection conn = repo.getConnection(); try { Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } }
private void endTest(BigdataSailRepositoryConnection cxn) throws Exception { cxn.close(); cxn.getTripleStore().close(); IJournal store = ((LocalTripleStore)cxn.getTripleStore()).getIndexManager(); store.shutdownNow(); store.destroy(); }
private void executeQuery(final BigdataSailRepository repo) throws UpdateExecutionException, RepositoryException, MalformedQueryException { try { repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); try { String update = "insert {" + "<http://dbpedia.org/resource/Jules_Verne> <http://dbpedia.org/property/period> \"\"^^<http://www.w3.org/2001/XMLSchema#int>\r\n" + "} where {}"; Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } } finally { repo.shutDown(); } }
/** * Verify that the named kb exists. * * @throws SailException */ private void assertKBExists(final Journal jnl, final String namespace) throws RepositoryException, SailException { // Attempt to discover the KB instance. BigdataSailRepositoryConnection conn = null; try { // Request query connection. conn = getQueryConnection(jnl, namespace, ITx.READ_COMMITTED); // Verify KB exists. assertNotNull(namespace, conn); } finally { // Ensure connection is closed. if (conn != null) conn.close(); } }
/** * Verify that the named kb does not exist. * * @throws SailException */ private void assertKBNotFound(final Journal jnl, final String namespace) throws RepositoryException, SailException { // Attempt to discover the KB instance. BigdataSailRepositoryConnection conn = null; try { // Request query connection. conn = getQueryConnection(jnl, namespace, ITx.READ_COMMITTED); // Verify KB does not exist. assertNull(namespace, conn); } finally { // Ensure connection is closed. if (conn != null) conn.close(); } }
private void executeUpdate(final BigdataSailRepository repo, final String update) throws UpdateExecutionException, RepositoryException, MalformedQueryException { final BigdataSailRepositoryConnection conn = repo.getConnection(); try { Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } }
private void endTest(BigdataSailRepositoryConnection cxn) throws Exception { cxn.close(); cxn.getTripleStore().close(); IJournal store = ((LocalTripleStore)cxn.getTripleStore()).getIndexManager(); store.shutdownNow(); store.destroy(); }
private void executeQuery(final BigdataSailRepository repo) throws UpdateExecutionException, RepositoryException, MalformedQueryException { try { repo.initialize(); final BigdataSailRepositoryConnection conn = repo.getConnection(); try { String update = "insert {" + "<http://dbpedia.org/resource/Jules_Verne> <http://dbpedia.org/property/period> \"\"^^<http://www.w3.org/2001/XMLSchema#int>\r\n" + "} where {}"; Update preparedUpdate = conn.prepareUpdate(QueryLanguage.SPARQL, update); preparedUpdate.execute(); // no exception should occur on execution, overwise test will fail } finally { conn.close(); } } finally { repo.shutDown(); } }