use of org.apache.ignite.transactions.TransactionConcurrency in project ignite by apache.
the class IgniteTxStoreExceptionAbstractSelfTest method testPutNearTx.
/**
* @throws Exception If failed.
*/
public void testPutNearTx() throws Exception {
for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
for (TransactionIsolation isolation : TransactionIsolation.values()) {
checkPutTx(true, concurrency, isolation, keyForNode(grid(0).localNode(), NOT_PRIMARY_AND_BACKUP));
checkPutTx(false, concurrency, isolation, keyForNode(grid(0).localNode(), NOT_PRIMARY_AND_BACKUP));
}
}
}
use of org.apache.ignite.transactions.TransactionConcurrency in project ignite by apache.
the class IgniteTxExceptionAbstractSelfTest method testPutPrimaryTx.
/**
* @throws Exception If failed.
*/
public void testPutPrimaryTx() throws Exception {
for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
for (TransactionIsolation isolation : TransactionIsolation.values()) {
checkPutTx(true, concurrency, isolation, keyForNode(grid(0).localNode(), PRIMARY));
checkPutTx(false, concurrency, isolation, keyForNode(grid(0).localNode(), PRIMARY));
}
}
}
use of org.apache.ignite.transactions.TransactionConcurrency in project ignite by apache.
the class IgniteTxExceptionAbstractSelfTest method testPutNearTx.
/**
* @throws Exception If failed.
*/
public void testPutNearTx() throws Exception {
for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
for (TransactionIsolation isolation : TransactionIsolation.values()) {
checkPutTx(true, concurrency, isolation, keyForNode(grid(0).localNode(), NOT_PRIMARY_AND_BACKUP));
checkPutTx(false, concurrency, isolation, keyForNode(grid(0).localNode(), NOT_PRIMARY_AND_BACKUP));
}
}
}
use of org.apache.ignite.transactions.TransactionConcurrency in project ignite by apache.
the class WithKeepBinaryCacheFullApiTest method testInvokeAllAsyncTx.
/**
* @throws Exception If failed.
*/
@SuppressWarnings("serial")
public void testInvokeAllAsyncTx() throws Exception {
if (!txShouldBeUsed())
return;
for (TransactionConcurrency conc : TransactionConcurrency.values()) {
for (TransactionIsolation isolation : TransactionIsolation.values()) {
checkInvokeAllAsycnTx(conc, isolation);
jcache().removeAll();
}
}
}
use of org.apache.ignite.transactions.TransactionConcurrency in project ignite by apache.
the class IndexingSpiQuerySelfTest method testIndexingSpiFailure.
/**
* @throws Exception If failed.
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
public void testIndexingSpiFailure() throws Exception {
IgniteConfiguration cfg = configuration();
cfg.setIndexingSpi(new MyBrokenIndexingSpi());
Ignite ignite = Ignition.start(cfg);
CacheConfiguration<Integer, Integer> ccfg = cacheConfiguration(CACHE_NAME);
ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
final IgniteCache<Integer, Integer> cache = ignite.createCache(ccfg);
final IgniteTransactions txs = ignite.transactions();
for (final TransactionConcurrency concurrency : TransactionConcurrency.values()) {
for (final TransactionIsolation isolation : TransactionIsolation.values()) {
System.out.println("Run in transaction: " + concurrency + " " + isolation);
GridTestUtils.assertThrowsWithCause(new Callable<Void>() {
@Override
public Void call() throws Exception {
Transaction tx;
try (Transaction tx0 = tx = txs.txStart(concurrency, isolation)) {
cache.put(1, 1);
tx0.commit();
}
assertEquals(TransactionState.ROLLED_BACK, tx.state());
return null;
}
}, IgniteTxHeuristicCheckedException.class);
}
}
}
Aggregations