/** * Return a read-only connection. * * @throws RepositoryException */ private BigdataSailRepositoryConnection getQueryConnection() throws RepositoryException { final BigdataSailRepositoryConnection c = m_repo .getReadOnlyConnection(); return c; }
/** * Return a read-only connection. * * @throws RepositoryException */ private BigdataSailRepositoryConnection getQueryConnection() throws RepositoryException { final BigdataSailRepositoryConnection c = m_repo .getReadOnlyConnection(); return c; }
/** * Overridden to use {@link BigdataSail#getReadOnlyConnection()} as a * workaround to the test harness which invokes * {@link BigdataSail#getConnection()} multiple times from within the same * thread. When full transactions are not enabled, that will delegate to * {@link BigdataSail#getUnisolatedConnection()}. Only one unisolated * connection is permitted at a time. While different threads will block to * await the unisolated connection, that method will throw an exception if * there is an attempt by a single thread to obtain more than one instance * of the unisolated connection (since that operation would otherwise * deadlock). */ protected BigdataSailRepositoryConnection getQueryConnection( Repository dataRep) throws Exception { // // See #1196 (Enable BigdataEmbeddedFederationSparqlTest tests in CI) // return ((BigdataSailRepository) ((DatasetRepository) dataRep) // .getDelegate()).getReadOnlyConnection(); return ((BigdataSailRepository) dataRep) .getReadOnlyConnection(); }
public BigdataReadOnlyGraph getReadOnlyView() throws Exception { if (log.isDebugEnabled()) log.debug("get read-only view: " + Thread.currentThread().getName()); return new BigdataReadOnlyGraph( repo.getReadOnlyConnection(), factory, maxQueryTime); }
/** * Overridden to use {@link BigdataSail#getReadOnlyConnection()} as a * workaround to the test harness which invokes * {@link BigdataSail#getConnection()} multiple times from within the same * thread. When full transactions are not enabled, that will delegate to * {@link BigdataSail#getUnisolatedConnection()}. Only one unisolated * connection is permitted at a time. While different threads will block to * await the unisolated connection, that method will throw an exception if * there is an attempt by a single thread to obtain more than one instance * of the unisolated connection (since that operation would otherwise * deadlock). */ protected BigdataSailRepositoryConnection getQueryConnection( Repository dataRep) throws Exception { // // See #1196 (Enable BigdataEmbeddedFederationSparqlTest tests in CI) // return ((BigdataSailRepository) ((DatasetRepository) dataRep) // .getDelegate()).getReadOnlyConnection(); return ((BigdataSailRepository) dataRep) .getReadOnlyConnection(); }
conn = repo.getReadOnlyConnection(); conn.setAutoCommit(false);
public static TupleQueryResult executeSelectQuery(Repository repo, String query, QueryLanguage ql) throws OpenRDFException { RepositoryConnection cxn; if (repo instanceof BigdataSailRepository) { cxn = ((BigdataSailRepository) repo).getReadOnlyConnection(); } else { cxn = repo.getConnection(); } try { final TupleQuery tupleQuery = cxn.prepareTupleQuery(ql, query); tupleQuery.setIncludeInferred(true /* includeInferred */); return tupleQuery.evaluate(); } finally { // close the repository connection cxn.close(); } }
public static TupleQueryResult executeSelectQuery(final Repository repo, final String query, final QueryLanguage ql) throws OpenRDFException { RepositoryConnection cxn; if (repo instanceof BigdataSailRepository) { cxn = ((BigdataSailRepository) repo).getReadOnlyConnection(); } else { cxn = repo.getConnection(); } try { final TupleQuery tupleQuery = cxn.prepareTupleQuery(ql, query); tupleQuery.setIncludeInferred(true /* includeInferred */); return tupleQuery.evaluate(); } finally { // close the repository connection cxn.close(); } } }
public static TupleQueryResult executeSelectQuery(final Repository repo, final String query, final QueryLanguage ql) throws OpenRDFException { RepositoryConnection cxn; if (repo instanceof BigdataSailRepository) { cxn = ((BigdataSailRepository) repo).getReadOnlyConnection(); } else { cxn = repo.getConnection(); } try { final TupleQuery tupleQuery = cxn.prepareTupleQuery(ql, query); tupleQuery.setIncludeInferred(true /* includeInferred */); return tupleQuery.evaluate(); } finally { // close the repository connection cxn.close(); } } }
/** * This version uses the namespace and timestamp provided by the caller. * * @param namespace * @param timestamp * @return * @throws RepositoryException * @throws DatasetNotFoundException */ protected BigdataSailRepositoryConnection getQueryConnection( final String namespace, final long timestamp) throws RepositoryException { // Wrap with SAIL. final BigdataSail sail = new BigdataSail(namespace, getIndexManager()); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); if (TimestampUtility.isReadOnly(timestamp)) { return (BigdataSailRepositoryConnection) repo.getReadOnlyConnection(timestamp); } // Read-write connection. final BigdataSailRepositoryConnection conn = repo.getConnection(); conn.setAutoCommit(false); return conn; }
/** * This version uses the namespace and timestamp provided by the caller. * * @param namespace * @param timestamp * @return * @throws RepositoryException * @throws DatasetNotFoundException */ protected BigdataSailRepositoryConnection getQueryConnection( final String namespace, final long timestamp) throws RepositoryException { // Wrap with SAIL. final BigdataSail sail = new BigdataSail(namespace, getIndexManager()); final BigdataSailRepository repo = new BigdataSailRepository(sail); repo.initialize(); if (TimestampUtility.isReadOnly(timestamp)) { return (BigdataSailRepositoryConnection) repo.getReadOnlyConnection(timestamp); } // Read-write connection. final BigdataSailRepositoryConnection conn = repo.getConnection(); conn.setAutoCommit(false); return conn; }
(BigdataSailRepositoryConnection) repo.getReadOnlyConnection(); readView = repo.getReadOnlyConnection();
.getReadOnlyConnection(timestamp);
conn = repo.getReadOnlyConnection(); conn.setAutoCommit(false);
cxn = ((BigdataSailRepository) repo).getReadOnlyConnection(); } else { cxn = repo.getConnection();
final BigdataSailRepositoryConnection cxn = bigdataRepo.getReadOnlyConnection(); try {
(BigdataSailRepositoryConnection) repo.getReadOnlyConnection(); readView = repo.getReadOnlyConnection();
final BigdataSailRepositoryConnection cxn = bigdataRepo.getReadOnlyConnection(); try {
RepositoryConnection view = repo.getReadOnlyConnection();
RepositoryConnection view = repo.getReadOnlyConnection();