Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.Dataset.end()


        Dataset ds = create() ;
        ds.begin(ReadWrite.WRITE) ;
        assertTrue(ds.isInTransaction()) ;
        ds.abort() ;
        assertFalse(ds.isInTransaction()) ;
        ds.end() ;
        assertFalse(ds.isInTransaction()) ;
    }

    @Test
    public void transaction_06() {
View Full Code Here


        try {
            ds.begin(mode2) ;
            fail("Expected transaction exception - begin-begin (" + mode1 + ", " + mode2 + ")") ;
        }
        catch (JenaTransactionException ex) {
            ds.end() ;
        }
    }
   
    private void testCommitCommit(ReadWrite mode) {
        Dataset ds = create() ;
View Full Code Here

        try {
            ds.commit() ;
            fail("Expected transaction exception - commit-commit(" + mode + ")") ;
        }
        catch (JenaTransactionException ex) {
            ds.end() ;
        }
    }

    private void testCommitAbort(ReadWrite mode) {
        Dataset ds = create() ;
View Full Code Here

        try {
            ds.abort() ;
            fail("Expected transaction exception - commit-abort(" + mode + ")") ;
        }
        catch (JenaTransactionException ex) {
            ds.end() ;
        }
    }

    private void testAbortAbort(ReadWrite mode) {
        Dataset ds = create() ;
View Full Code Here

        try {
            ds.abort() ;
            fail("Expected transaction exception - abort-abort(" + mode + ")") ;
        }
        catch (JenaTransactionException ex) {
            ds.end() ;
        }
    }

    private void testAbortCommit(ReadWrite mode) {
        Dataset ds = create() ;
View Full Code Here

        try {
            ds.commit() ;
            fail("Expected transaction exception - abort-commit(" + mode + ")") ;
        }
        catch (JenaTransactionException ex) {
            ds.end() ;
        }
    }   
}
View Full Code Here

        totalExecTime += writeOperationDuration;
        System.out.println("Write operation " + i + " took " + writeOperationDuration + "ms");
      }
    }
        if ( bracketWithReader )
            dataset1.end() ;

    System.out.println("All " + TOTAL + " write operations wrote " + size + " triples and took " + totalExecTime + "ms");
  }

}
View Full Code Here

        // Check API methods work.
        Dataset ds = TDBFactory.createDataset(loc) ;
        ds.begin(ReadWrite.READ) ;
        Model m = (q.isDefaultGraph() ? ds.getDefaultModel() : ds.getNamedModel("g")) ;
        assertEquals( nonTxnData ? 2 : 1 , m.size()) ;
        ds.end() ;
    }

   
}
View Full Code Here

            dataset.commit();
        } catch ( Exception e ) {
            e.printStackTrace(System.err);
            dataset.abort();
        } finally {
            dataset.end();
        }
        RiotWriter.writeNQuads(System.out, dataset.asDatasetGraph());
    }

}
View Full Code Here

        } finally
        {
            // Notify the end of the READ transaction.
            // Any use of dataset.abort() or dataset.commit() or dataset.end()
            // .end() can be called multiple times for the same .begin(READ)
            dataset.end() ;
        }
    }
   
    public static void execQuery(String sparqlQueryString, Dataset dataset)
    {
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.