use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class AbstractStoreConnections method store_2.
@Test(expected = TDBTransactionException.class)
public void store_2() {
// Expel.
StoreConnection sConn = getStoreConnection();
DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ);
StoreConnection.release(sConn.getLocation());
}
use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class AbstractStoreConnections method store_4.
@Test
public void store_4() {
StoreConnection sConn = getStoreConnection();
DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ);
DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE);
dsgW1.add(q1);
dsgW1.commit();
dsgW1.end();
dsgR1.end();
StoreConnection.release(sConn.getLocation());
sConn = null;
StoreConnection sConn2 = getStoreConnection();
DatasetGraphTxn dsgW2 = sConn2.begin(ReadWrite.WRITE);
dsgW2.add(q2);
dsgW2.commit();
dsgW2.end();
DatasetGraphTxn dsgR2 = sConn2.begin(ReadWrite.READ);
long x = Iter.count(dsgR2.find());
assertEquals(2, x);
}
use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class AbstractStoreConnections method store_0.
@Test
public void store_0() {
// Expel.
StoreConnection sConn = getStoreConnection();
assertTrue(sConn.isValid());
DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE);
dsgW1.commit();
dsgW1.end();
StoreConnection.release(sConn.getLocation());
StoreConnection sConn2 = getStoreConnection();
}
use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class TestTransRestart method testTxn.
@Test
public void testTxn() {
assertEquals(3, countRDFNodes());
StoreConnection sc = StoreConnection.make(location);
DatasetGraphTxn dsg = sc.begin(ReadWrite.WRITE);
assertTrue(dsg.contains(quad1));
dsg.add(quad2);
dsg.commit();
dsg.end();
StoreConnection.release(location);
assertEquals(4, countRDFNodes());
}
use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class AbstractTestTransSeq method trans_03.
@Test
public void trans_03() {
// WRITE-commit-READ-check
StoreConnection sConn = getStoreConnection();
DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE);
dsgW.add(q);
assertTrue(dsgW.contains(q));
dsgW.commit();
dsgW.end();
DatasetGraphTxn dsg2 = sConn.begin(ReadWrite.READ);
assertTrue(dsg2.contains(q));
dsg2.end();
sConn.flush();
DatasetGraph dsg = sConn.getBaseDataset();
assertTrue(dsg.contains(q));
}
Aggregations