Package com.hp.hpl.jena.query

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


            // Notify the end of the transaction.
            // The transaction was finished at the point .commit or .abort was called.
            // .end will force an abort() if no previous call to .commit() or .abort()
            // has occurred, so .end() help manage track the state of the transaction.
            // .end() can be called multiple times for the same .begin(WRITE)
            dataset.end() ;
        }
    }
   
    public static void execUpdate(String sparqlUpdateString, GraphStore graphStore)
    {
View Full Code Here


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

    @Test public void transaction_2()
    {
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_5()
    {
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_6()
    {
View Full Code Here

        try {
            int n = count(dataset) ;
            assertEquals(1, n) ;
            n = count(dataset, "SELECT * { <x:s> <x:p> <x:o>}") ;
            assertEquals(1, n) ;
        } finally { dataset.end() ; }
    }

    @Test public void sparql_txn_2()
    {
        Dataset dataset1 = create(Location.mem("foo")) ;
View Full Code Here

        update(dataset2, "INSERT DATA { <x:s> <x:p> <x:o2> }") ;
       
        assertEquals(1, count(dataset1)) ;
        assertEquals(2, count(dataset2)) ;
        dataset2.commit();
        dataset2.end() ;
       
        // This is 2 if dataset1 is not in a transaction
        // but that replies on dataset2 commit doing the write back.
        assertEquals(1, count(dataset1))
       
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

                }
            } finally {
                qexec.close();
            }
        } finally {
            dataset.end();
        }
    }

}
View Full Code Here

            TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(dataset.asDatasetGraph()), in, false);
            dataset.commit();
        } catch (Exception e) {
            dataset.abort();
        } finally {
            dataset.end();
        }

        dataset.begin(ReadWrite.READ);
        try {
            Iterator<Quad> iter = dataset.asDatasetGraph().find();
View Full Code Here

            while ( iter.hasNext() ) {
                Quad quad = iter.next();
                System.out.println(quad);
            }
        } finally {
            dataset.end();
        }
    }

}
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.