boolean nonTxnData = true ;
StoreConnection sConn = getStoreConnection() ;
Location loc = sConn.getLocation() ;
DatasetGraph dsg = sConn.getBaseDataset() ;
if ( nonTxnData )
{
dsg.add(q) ;
TDB.sync(dsg) ;
assertTrue(dsg.contains(q)) ;
}
DatasetGraphTxn dsgTxn = sConn.begin(ReadWrite.WRITE) ;
if ( nonTxnData )
assertTrue(dsgTxn.contains(q)) ;
dsgTxn.add(q1) ;
assertTrue(dsgTxn.contains(q1)) ;
if ( nonTxnData )
assertTrue(dsgTxn.contains(q)) ;
dsgTxn.commit() ;
dsgTxn.end() ;
// Should have flushed to disk.
if ( nonTxnData )
{
sConn.forceRecoverFromJournal() ;
assertTrue(dsg.contains(q)) ;
}
assertTrue(dsg.contains(q1)) ;
// release via the transactional machinery
StoreConnection.release(loc) ;
sConn = null ;
StoreConnection sConn2 = StoreConnection.make(loc) ;
DatasetGraph dsg2 = sConn2.getBaseDataset() ;
if ( nonTxnData )
assertTrue(dsg2.contains(q)) ;
assertTrue(dsg2.contains(q1)) ;
DatasetGraphTxn dsgTxn2 = sConn2.begin(ReadWrite.READ) ;
if ( nonTxnData )
assertTrue(dsgTxn2.contains(q)) ;
assertTrue(dsgTxn2.contains(q1)) ;