Package com.hp.hpl.jena.query

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


                 "PREFIX . <http://example/>",
                 "INSERT { :s :p ?now } WHERE { BIND(now() AS ?now) }"
                 ) ;

            execUpdate(sparqlUpdateString, graphStore) ;
            dataset.commit() ;
            // Or call .abort()
           
        } finally
        {
            // Notify the end of the transaction.
View Full Code Here


    @Test public void factoryTxn2()
    {
        Dataset ds = create() ;
        ds.begin(ReadWrite.WRITE) ;
        assertTrue(ds.isInTransaction()) ;
        ds.commit() ;
        assertFalse(ds.isInTransaction()) ;
    }

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

    @Test public void factoryTxn4()
    {
        Dataset ds = create() ;
        ds.begin(ReadWrite.WRITE) ;
        assertTrue(ds.isInTransaction()) ;
        ds.commit() ;
        assertFalse(ds.isInTransaction()) ;
        ds.end() ;
        assertFalse(ds.isInTransaction()) ;
    }
View Full Code Here

        ds1.begin(ReadWrite.WRITE) ;
        ds1.getDefaultModel().getGraph().add(triple1) ;
       
        ds2.begin(ReadWrite.READ) ;
        assertTrue(ds2.getDefaultModel().isEmpty()) ;
        ds2.commit() ;
       
        ds1.commit() ;

        ds2.begin(ReadWrite.READ) ;
        assertFalse(ds2.getDefaultModel().isEmpty()) ;
View Full Code Here

        ds1.commit() ;

        ds2.begin(ReadWrite.READ) ;
        assertFalse(ds2.getDefaultModel().isEmpty()) ;
        assertEquals(1, ds2.getDefaultModel().size()) ;
        ds2.commit() ;
    }

}
View Full Code Here

    @Test
    public void transaction_02() {
        Dataset ds = create() ;
        ds.begin(ReadWrite.WRITE) ;
        assertTrue(ds.isInTransaction()) ;
        ds.commit() ;
        assertFalse(ds.isInTransaction()) ;
    }

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

    @Test
    public void transaction_04() {
        Dataset ds = create() ;
        ds.begin(ReadWrite.WRITE) ;
        assertTrue(ds.isInTransaction()) ;
        ds.commit() ;
        assertFalse(ds.isInTransaction()) ;
        ds.end() ;
        assertFalse(ds.isInTransaction()) ;
    }
View Full Code Here

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

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

    }

    private void testCommitAbort(ReadWrite mode) {
        Dataset ds = create() ;
        ds.begin(mode) ;
        ds.commit() ;
        try {
            ds.abort() ;
            fail("Expected transaction exception - commit-abort(" + mode + ")") ;
        }
        catch (JenaTransactionException ex) {
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.