use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class AbstractTestTransSeq method trans_05.
@Test
public void trans_05() {
// WRITE(commit)-WRITE(commit)-READ-check
StoreConnection sConn = getStoreConnection();
DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE);
dsgW1.add(q1);
dsgW1.commit();
dsgW1.end();
DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE);
dsgW2.add(q2);
dsgW2.commit();
dsgW2.end();
DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ);
assertTrue(dsgR2.contains(q1));
assertTrue(dsgR2.contains(q2));
dsgR2.end();
sConn.flush();
DatasetGraph dsg = sConn.getBaseDataset();
assertTrue(dsg.contains(q1));
assertTrue(dsg.contains(q2));
}
use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class AbstractTestTransSeq method trans_readBlock_02.
@Test
public void trans_readBlock_02() {
// READ(start)-WRITE(abort)-READ(finish)-check
StoreConnection sConn = getStoreConnection();
DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ);
DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE);
dsgW.add(q);
dsgW.abort();
dsgW.end();
assertFalse(dsgR1.contains(q));
dsgR1.end();
DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ);
assertFalse(dsgR2.contains(q));
dsgR2.end();
DatasetGraph dsg = sConn.getBaseDataset();
assertFalse(dsg.contains(q));
}
use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class T_TransSystem method beforeClass.
@BeforeClass
public static void beforeClass() {
if (!LOC.isMem())
FileOps.clearDirectory(LOC.getDirectoryPath());
StoreConnection.reset();
StoreConnection sConn = StoreConnection.make(LOC);
DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE);
dsg.add(q1);
dsg.add(q2);
initCount = 2;
dsg.commit();
dsg.end();
}
use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class T_TransSystem method manyRead.
//@Test
public void manyRead() {
final StoreConnection sConn = getStoreConnection();
// Number of repeats, max pause
Callable<?> proc = new Reader(sConn, 50, 200);
for (int i = 0; i < 5; i++) execService.submit(proc);
try {
execService.shutdown();
execService.awaitTermination(100, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace(System.err);
}
}
use of org.apache.jena.tdb.StoreConnection in project jena by apache.
the class T_TransSystemMultiDatasets method manyRead.
//@Test
public void manyRead() {
final StoreConnection sConn = getStoreConnection();
// Number of repeats, max pause
Callable<?> proc = new ReaderTx(this, 50, 200);
for (int i = 0; i < 5; i++) execService.submit(proc);
try {
execService.shutdown();
execService.awaitTermination(100, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Aggregations