Search in sources :

Example 6 with TransactionConfiguration

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;
}
Also used : TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration)

Example 7 with TransactionConfiguration

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;
}
Also used : TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 8 with TransactionConfiguration

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;
}
Also used : TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 9 with TransactionConfiguration

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();
}
Also used : TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration)

Example 10 with TransactionConfiguration

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;
}
Also used : TransactionConfiguration(org.apache.ignite.configuration.TransactionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)

Aggregations

TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)28 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)14 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)10 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)9 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)6 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)4 TransactionManager (org.objectweb.transaction.jta.TransactionManager)4 HashMap (java.util.HashMap)3 Transaction (javax.transaction.Transaction)3 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)3 GridNearTxLocal (org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal)3 LinkedHashMap (java.util.LinkedHashMap)2 IGNITE_CACHE_RETRIES_COUNT (org.apache.ignite.IgniteSystemProperties.IGNITE_CACHE_RETRIES_COUNT)2 BinaryBasicNameMapper (org.apache.ignite.binary.BinaryBasicNameMapper)2 AtomicConfiguration (org.apache.ignite.configuration.AtomicConfiguration)2 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)2 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)2 BROADCAST (org.apache.ignite.internal.GridClosureCallMode.BROADCAST)2 PlatformDotNetBinaryConfiguration (org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration)2 NoopEventStorageSpi (org.apache.ignite.spi.eventstorage.NoopEventStorageSpi)2