use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.
the class TxDeadlockCauseTest method testCause.
/**
* @throws Exception If failed.
*/
@Test
public void testCause() throws Exception {
startGrids(1);
for (TransactionIsolation isolation : TransactionIsolation.values()) {
checkCauseObject(1, 2, 1000, isolation, true);
checkCauseObject(1, 2, 1000, isolation, false);
}
}
use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.
the class TxDeadlockCauseTest method testCauseSeveralNodes.
/**
* @throws Exception If failed.
*/
@Test
public void testCauseSeveralNodes() throws Exception {
startGrids(2);
for (TransactionIsolation isolation : TransactionIsolation.values()) {
checkCauseObject(2, 2, 1500, isolation, true);
checkCauseObject(2, 2, 1500, isolation, false);
}
}
use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.
the class TxDeadlockCauseTest method testCauseNear.
/**
* @throws Exception If failed.
*/
@Test
public void testCauseNear() throws Exception {
ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL).setNearConfiguration(new NearCacheConfiguration());
startGrids(1);
for (TransactionIsolation isolation : TransactionIsolation.values()) {
checkCauseObject(1, 2, 1000, isolation, true);
checkCauseObject(1, 2, 1000, isolation, false);
}
}
use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.
the class TxDeadlockCauseTest method testCauseSeveralNodesNear.
/**
* @throws Exception If failed.
*/
@Test
public void testCauseSeveralNodesNear() throws Exception {
ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME).setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL).setNearConfiguration(new NearCacheConfiguration());
startGrids(4);
for (TransactionIsolation isolation : TransactionIsolation.values()) {
checkCauseObject(2, 2, 2000, isolation, true);
checkCauseObject(2, 2, 2000, isolation, false);
}
}
use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.
the class CacheReadThroughRestartSelfTest method testReadThroughInTx.
/**
* @throws Exception If failed.
*/
private void testReadThroughInTx(boolean needVer) throws Exception {
IgniteCache<String, Integer> cache = grid(1).cache(DEFAULT_CACHE_NAME);
for (int k = 0; k < 1000; k++) cache.put("key" + k, k);
stopAllGrids();
startGrids(2);
awaitPartitionMapExchange();
Ignite ignite = grid(1);
cache = ignite.cache(DEFAULT_CACHE_NAME).withAllowAtomicOpsInTx();
for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) {
for (TransactionIsolation txIsolation : TransactionIsolation.values()) {
if (MvccFeatureChecker.forcedMvcc() && !MvccFeatureChecker.isSupported(txConcurrency, txIsolation))
continue;
try (Transaction tx = ignite.transactions().txStart(txConcurrency, txIsolation, 100000, 1000)) {
for (int k = 0; k < 1000; k++) {
String key = "key" + k;
if (needVer) {
assertNotNull("Null value for key: " + key, cache.getEntry(key));
assertNotNull("Null value for key: " + key, cache.getEntry(key));
} else {
assertNotNull("Null value for key: " + key, cache.get(key));
assertNotNull("Null value for key: " + key, cache.get(key));
}
}
tx.commit();
}
}
}
}
Aggregations