Package com.hp.hpl.jena.query

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


            while ( iter.hasNext() ) {
                Quad quad = iter.next();
                System.out.println(quad);
            }
        } finally {
            dataset.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

            dataset.commit();
        } catch ( Exception e ) {
            e.printStackTrace(System.err);
            if ( dataset.isInTransaction() ) dataset.abort();
        } finally {
            dataset.end();
        }
        assertEquals ( 1, dataset.getDefaultModel().size() );
    }
   
}
View Full Code Here

            dataset.commit();
        } catch ( Exception e ) {
            e.printStackTrace(System.err);
            if ( dataset.isInTransaction() ) dataset.abort();
        } finally {
            dataset.end();
        }
        assertEquals ( 1, dataset.getDefaultModel().size() );
    }
   
    @Test public void test_04() {
View Full Code Here

            dataset.commit();
        } catch ( Exception e ) {
            e.printStackTrace(System.err);
            if ( dataset.isInTransaction() ) dataset.abort();
        } finally {
            dataset.end();
        }
        assertEquals ( 1, dataset.getDefaultModel().size() );
    }
   
    @Test public void test_06() {
View Full Code Here

        try {
            Model model = dataset.getDefaultModel();
            model.add ( ResourceFactory.createResource(), RDFS.label, value, "en-gb" );
            dataset.commit();
        } finally {
            dataset.end();
        }
    }

}
View Full Code Here

    @Test public void transaction_01()
    {
        Dataset ds = create() ;
        ds.begin(ReadWrite.READ) ;
        assertTrue(ds.isInTransaction()) ;
        ds.end() ;
        assertFalse(ds.isInTransaction()) ;
    }

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

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

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

        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

        ds.begin(mode1) ;
        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

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.