use of org.apache.jena.tdb.transaction.DatasetGraphTransaction in project jena by apache.
the class ExTDB_Txn3 method main.
public static void main(String... argv) {
DatasetGraphTransaction dsg = (DatasetGraphTransaction) TDBFactory.createDatasetGraph();
// Start READ transaction.
dsg.begin(ReadWrite.READ);
try {
// Do some queries
String sparqlQueryString1 = "SELECT (count(*) AS ?count) { ?s ?p ?o }";
execQuery(sparqlQueryString1, dsg);
} finally {
dsg.end();
}
}
use of org.apache.jena.tdb.transaction.DatasetGraphTransaction in project jena by apache.
the class DataService method shutdown.
private void shutdown() {
Fuseki.serverLog.info("Shutting down dataset");
dataset.close();
if (dataset instanceof DatasetGraphTransaction) {
DatasetGraphTransaction dsgtxn = (DatasetGraphTransaction) dataset;
StoreConnection.release(dsgtxn.getLocation());
}
dataset = null;
}
use of org.apache.jena.tdb.transaction.DatasetGraphTransaction in project jena by apache.
the class TestTDBFactory method testTDBMakerTxn2.
@Test
public void testTDBMakerTxn2() {
// Named memory locations
TDBMaker.reset();
DatasetGraph dg1 = TDBMaker.createDatasetGraphTransaction(Location.mem("FOO"));
DatasetGraph dg2 = TDBMaker.createDatasetGraphTransaction(Location.mem("FOO"));
DatasetGraph dgBase1 = ((DatasetGraphTransaction) dg1).getBaseDatasetGraph();
DatasetGraph dgBase2 = ((DatasetGraphTransaction) dg2).getBaseDatasetGraph();
assertSame(dgBase1, dgBase2);
}
use of org.apache.jena.tdb.transaction.DatasetGraphTransaction in project jena by apache.
the class TestTDBFactory method testTDBMakerTxn1.
@Test
public void testTDBMakerTxn1() {
TDBMaker.reset();
DatasetGraph dg1 = TDBMaker.createDatasetGraphTransaction(Location.create(DIR));
DatasetGraph dg2 = TDBMaker.createDatasetGraphTransaction(Location.create(DIR));
DatasetGraph dgBase1 = ((DatasetGraphTransaction) dg1).getBaseDatasetGraph();
DatasetGraph dgBase2 = ((DatasetGraphTransaction) dg2).getBaseDatasetGraph();
assertSame(dgBase1, dgBase2);
}
Aggregations