private void writer(final RepositoryConnection conn) throws RepositoryException, MalformedQueryException, QueryEvaluationException, InterruptedException { final URI subj = conn.getValueFactory().createURI( "u:s" + (counter++)); final Value value = conn.getValueFactory().createLiteral( "literal" + counter); query(conn); // Thread.sleep(200); conn.add(subj, conn.getValueFactory().createURI("u:p"), subj); conn.add(subj, conn.getValueFactory().createURI("u:p"), value); conn.commit(); if(log.isInfoEnabled()) log.info("Added statements: size="+conn.size()); // if (counter % 12 == 0) { // conn.close(); // conn = repo.getConnection(); // conn.setAutoCommit(false); // } }
private void writer(final RepositoryConnection conn) throws RepositoryException, MalformedQueryException, QueryEvaluationException, InterruptedException { final URI subj = conn.getValueFactory().createURI( "u:s" + (counter++)); final Value value = conn.getValueFactory().createLiteral( "literal" + counter); query(conn); // Thread.sleep(200); conn.add(subj, conn.getValueFactory().createURI("u:p"), subj); conn.add(subj, conn.getValueFactory().createURI("u:p"), value); conn.commit(); if(log.isInfoEnabled()) log.info("Added statements: size="+conn.size()); // if (counter % 12 == 0) { // conn.close(); // conn = repo.getConnection(); // conn.setAutoCommit(false); // } }
private void reader(final RepositoryConnection conn) throws RepositoryException, MalformedQueryException, QueryEvaluationException, InterruptedException { query(conn); // Thread.sleep(100); query(conn); ++counter; if (counter % 3 == 0) conn.commit(); else conn.rollback(); // if (counter % 7 == 0) { // conn.close(); // conn = repo.getConnection(); // conn.setAutoCommit(false); // } }
private void reader(final RepositoryConnection conn) throws RepositoryException, MalformedQueryException, QueryEvaluationException, InterruptedException { query(conn); // Thread.sleep(100); query(conn); ++counter; if (counter % 3 == 0) conn.commit(); else conn.rollback(); // if (counter % 7 == 0) { // conn.close(); // conn = repo.getConnection(); // conn.setAutoCommit(false); // } }