use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionCoordinatorControl method txn_coord_disable_writers_2.
@Test
public void txn_coord_disable_writers_2() {
txnMgr.blockWriters();
Transaction txn = ThreadLib.syncCallThread(() -> txnMgr.begin(TxnType.WRITE, false));
assertNull(txn);
txnMgr.enableWriters();
Transaction txn2 = ThreadLib.syncCallThread(() -> {
Transaction txn1 = txnMgr.begin(TxnType.WRITE, false);
assertNotNull(txn1);
txn1.abort();
txn1.end();
return txn1;
});
assertNotNull(txn2);
}
use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionCoordinatorControl method txn_coord_exclusive_1.
@Test
public void txn_coord_exclusive_1() {
txnMgr.startExclusiveMode();
ThreadLib.syncOtherThread(() -> {
Transaction txn1 = txnMgr.begin(TxnType.WRITE, false);
assertNull(txn1);
Transaction txn2 = txnMgr.begin(TxnType.READ, false);
assertNull(txn2);
});
txnMgr.finishExclusiveMode();
ThreadLib.syncOtherThread(() -> {
Transaction txn1 = txnMgr.begin(TxnType.WRITE, false);
assertNotNull(txn1);
Transaction txn2 = txnMgr.begin(TxnType.READ, false);
assertNotNull(txn2);
txn1.commit();
txn1.end();
txn2.commit();
txn2.end();
});
}
use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionLifecycle2 method txn_direct_01.
@Test
public void txn_direct_01() {
Transaction txn1 = txnMgr.begin(TxnType.READ);
txn1.end();
checkClear();
}
use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionLifecycle2 method txn_direct_05.
@Test
public void txn_direct_05() {
Transaction txn1 = txnMgr.begin(TxnType.WRITE);
txn1.prepare();
txn1.commit();
txn1.end();
checkClear();
}
use of org.apache.jena.dboe.transaction.txn.Transaction in project jena by apache.
the class TestTransactionLifecycle2 method txn_overlap_WW.
@Test
public void txn_overlap_WW() {
Transaction txn1 = txnMgr.begin(TxnType.WRITE, false);
assertNotNull(txn1);
Transaction txn2 = txnMgr.begin(TxnType.WRITE, false);
// Otherwise blocking.
assertNull(txn2);
txn1.commit();
txn1.end();
checkClear();
}
Aggregations