use of org.apache.ignite.configuration.TransactionConfiguration in project ignite by apache.
the class ReplicatedAtomicCacheGetsDistributionTest method transactionConfiguration.
/**
* @return Transaction configuration.
*/
protected TransactionConfiguration transactionConfiguration() {
TransactionConfiguration txCfg = new TransactionConfiguration();
txCfg.setDefaultTxIsolation(transactionIsolation());
txCfg.setDefaultTxConcurrency(transactionConcurrency());
return txCfg;
}
use of org.apache.ignite.configuration.TransactionConfiguration in project ignite by apache.
the class GridCacheTransformEventSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(IP_FINDER);
TransactionConfiguration tCfg = cfg.getTransactionConfiguration();
tCfg.setDefaultTxConcurrency(txConcurrency);
tCfg.setDefaultTxIsolation(txIsolation);
CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setName(CACHE_NAME);
ccfg.setCacheMode(cacheMode);
ccfg.setAtomicityMode(atomicityMode);
ccfg.setWriteSynchronizationMode(FULL_SYNC);
if (cacheMode == PARTITIONED)
ccfg.setBackups(BACKUP_CNT);
cfg.setDiscoverySpi(discoSpi);
cfg.setCacheConfiguration(ccfg);
cfg.setLocalHost("127.0.0.1");
cfg.setIncludeEventTypes(EVT_CACHE_OBJECT_READ);
return cfg;
}
use of org.apache.ignite.configuration.TransactionConfiguration in project ignite by apache.
the class GridCacheEmptyEntriesAbstractSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration c = super.getConfiguration(igniteInstanceName);
TransactionConfiguration txCfg = c.getTransactionConfiguration();
txCfg.setDefaultTxConcurrency(txConcurrency);
txCfg.setDefaultTxIsolation(txIsolation);
txCfg.setTxSerializableEnabled(true);
CacheConfiguration cc = defaultCacheConfiguration();
cc.setCacheMode(cacheMode());
cc.setAtomicityMode(TRANSACTIONAL);
cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
cc.setEvictionPolicy(plc);
cc.setOnheapCacheEnabled(true);
if (testStore != null) {
cc.setCacheStoreFactory(singletonFactory(testStore));
cc.setReadThrough(true);
cc.setWriteThrough(true);
cc.setLoadPreviousValue(true);
} else
cc.setCacheStoreFactory(null);
c.setCacheConfiguration(cc);
TcpDiscoverySpi disco = new TcpDiscoverySpi();
disco.setIpFinder(ipFinder);
c.setDiscoverySpi(disco);
return c;
}
use of org.apache.ignite.configuration.TransactionConfiguration in project ignite by apache.
the class IgniteTransactionsImpl method txStart.
/**
* {@inheritDoc}
*/
@Override
public Transaction txStart(TransactionConcurrency concurrency, TransactionIsolation isolation) {
A.notNull(concurrency, "concurrency");
A.notNull(isolation, "isolation");
TransactionConfiguration cfg = CU.transactionConfiguration(null, cctx.kernalContext().config());
return txStart0(concurrency, isolation, cfg.getDefaultTxTimeout(), 0, null).proxy();
}
use of org.apache.ignite.configuration.TransactionConfiguration in project ignite by apache.
the class IgniteCacheContainsKeyAbstractSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
cfg.setCommunicationSpi(commSpi);
TransactionConfiguration tcfg = new TransactionConfiguration();
tcfg.setTxSerializableEnabled(true);
cfg.setTransactionConfiguration(tcfg);
return cfg;
}
Aggregations