use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.
the class GridCacheBinaryObjectsAbstractSelfTest method testKeepBinaryTxOverwrite.
/**
* @throws Exception if failed.
*/
public void testKeepBinaryTxOverwrite() throws Exception {
if (atomicityMode() != TRANSACTIONAL)
return;
IgniteCache<Integer, TestObject> cache = ignite(0).cache(DEFAULT_CACHE_NAME);
cache.put(0, new TestObject(1));
for (TransactionConcurrency conc : TransactionConcurrency.values()) {
for (TransactionIsolation iso : TransactionIsolation.values()) {
try (Transaction tx = ignite(0).transactions().txStart(conc, iso)) {
cache.withKeepBinary().get(0);
cache.invoke(0, new ObjectEntryProcessor());
tx.commit();
}
}
}
}
use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.
the class GridTransformSpringInjectionSelfTest method testTransformResourceInjection.
/**
* @throws Exception If failed.
*/
public void testTransformResourceInjection() throws Exception {
Ignite grid = grid(0);
IgniteCache<String, Integer> cache = grid.createCache(cacheConfiguration(ATOMIC));
try {
doTransformResourceInjection(cache);
} finally {
cache.destroy();
}
cache = grid.createCache(cacheConfiguration(TRANSACTIONAL));
try {
doTransformResourceInjection(cache);
for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
for (TransactionIsolation isolation : TransactionIsolation.values()) {
IgniteTransactions txs = grid.transactions();
try (Transaction tx = txs.txStart(concurrency, isolation)) {
doTransformResourceInjection(cache);
tx.commit();
}
}
}
} finally {
cache.destroy();
}
}
Aggregations