use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionCoordinatorControl method txn_coord_disable_writers_3.
@Test
public void txn_coord_disable_writers_3() {
txnMgr.blockWriters();
Transaction txn = ThreadLib.syncCallThread(() -> {
Transaction tx = txnMgr.begin(TxnType.READ, false);
tx.end();
return tx;
});
assertNotNull(txn);
txnMgr.enableWriters();
Transaction txn1 = ThreadLib.syncCallThread(() -> {
Transaction tx = txnMgr.begin(TxnType.WRITE, false);
tx.commit();
tx.end();
return tx;
});
assertNotNull(txn1);
Transaction txn2 = ThreadLib.syncCallThread(() -> {
Transaction tx = txnMgr.begin(TxnType.READ, false);
tx.end();
return tx;
});
assertNotNull(txn2);
}
use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionLifecycle2 method txn_overlap_WR.
@Test
public void txn_overlap_WR() {
Transaction txn1 = txnMgr.begin(TxnType.WRITE, false);
assertNotNull(txn1);
Transaction txn2 = txnMgr.begin(TxnType.READ, false);
assertNotNull(txn2);
txn1.commit();
txn1.end();
txn2.end();
checkClear();
}
use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionLifecycle2 method txn_promote_3.
@Test
public void txn_promote_3() {
Transaction txn1 = txnMgr.begin(TxnType.READ);
boolean b = txn1.promote();
assertFalse(b);
b = txn1.promote();
assertFalse(b);
// Not a writer
txn1.end();
checkClear();
}
use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionLifecycle2 method txn_promote_2.
@Test
public void txn_promote_2() {
Transaction txn1 = txnMgr.begin(TxnType.WRITE);
boolean b = txn1.promote();
assertTrue(b);
b = txn1.promote();
assertTrue(b);
txn1.abort();
txn1.end();
checkClear();
}
use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionLifecycle2 method txn_direct_06.
@Test
public void txn_direct_06() {
Transaction txn1 = txnMgr.begin(TxnType.WRITE);
// txn1.prepare(); Optional.
txn1.commit();
txn1.end();
checkClear();
}
Aggregations