Search in sources :

Example 16 with TransactionIsolation

use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.

the class IgniteTxExceptionAbstractSelfTest method testPutBackupTx.

/**
 * @throws Exception If failed.
 */
public void testPutBackupTx() throws Exception {
    for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
        for (TransactionIsolation isolation : TransactionIsolation.values()) {
            checkPutTx(true, concurrency, isolation, keyForNode(grid(0).localNode(), BACKUP));
            checkPutTx(false, concurrency, isolation, keyForNode(grid(0).localNode(), BACKUP));
        }
    }
}
Also used : TransactionConcurrency(org.apache.ignite.transactions.TransactionConcurrency) TransactionIsolation(org.apache.ignite.transactions.TransactionIsolation)

Example 17 with TransactionIsolation

use of org.apache.ignite.transactions.TransactionIsolation 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));
        }
    }
}
Also used : TransactionConcurrency(org.apache.ignite.transactions.TransactionConcurrency) TransactionIsolation(org.apache.ignite.transactions.TransactionIsolation)

Example 18 with TransactionIsolation

use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.

the class IgniteTxStoreExceptionAbstractSelfTest method testPutMultipleKeysTx.

/**
 * @throws Exception If failed.
 */
public void testPutMultipleKeysTx() throws Exception {
    for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
        for (TransactionIsolation isolation : TransactionIsolation.values()) {
            checkPutTx(true, concurrency, isolation, keyForNode(grid(0).localNode(), PRIMARY), keyForNode(grid(0).localNode(), PRIMARY), keyForNode(grid(0).localNode(), PRIMARY));
            checkPutTx(false, concurrency, isolation, keyForNode(grid(0).localNode(), PRIMARY), keyForNode(grid(0).localNode(), PRIMARY), keyForNode(grid(0).localNode(), PRIMARY));
            if (gridCount() > 1) {
                checkPutTx(true, concurrency, isolation, keyForNode(grid(1).localNode(), PRIMARY), keyForNode(grid(1).localNode(), PRIMARY), keyForNode(grid(1).localNode(), PRIMARY));
                checkPutTx(false, concurrency, isolation, keyForNode(grid(1).localNode(), PRIMARY), keyForNode(grid(1).localNode(), PRIMARY), keyForNode(grid(1).localNode(), PRIMARY));
            }
        }
    }
}
Also used : TransactionConcurrency(org.apache.ignite.transactions.TransactionConcurrency) TransactionIsolation(org.apache.ignite.transactions.TransactionIsolation)

Example 19 with TransactionIsolation

use of org.apache.ignite.transactions.TransactionIsolation 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));
        }
    }
}
Also used : TransactionConcurrency(org.apache.ignite.transactions.TransactionConcurrency) TransactionIsolation(org.apache.ignite.transactions.TransactionIsolation)

Example 20 with TransactionIsolation

use of org.apache.ignite.transactions.TransactionIsolation in project ignite by apache.

the class IgniteTxExceptionAbstractSelfTest method testPutMultipleKeysTx.

/**
 * @throws Exception If failed.
 */
public void testPutMultipleKeysTx() throws Exception {
    for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
        for (TransactionIsolation isolation : TransactionIsolation.values()) {
            checkPutTx(true, concurrency, isolation, keyForNode(grid(0).localNode(), PRIMARY), keyForNode(grid(0).localNode(), PRIMARY), keyForNode(grid(0).localNode(), PRIMARY));
            checkPutTx(false, concurrency, isolation, keyForNode(grid(0).localNode(), PRIMARY), keyForNode(grid(0).localNode(), PRIMARY), keyForNode(grid(0).localNode(), PRIMARY));
            if (gridCount() > 1) {
                checkPutTx(true, concurrency, isolation, keyForNode(grid(1).localNode(), PRIMARY), keyForNode(grid(1).localNode(), PRIMARY), keyForNode(grid(1).localNode(), PRIMARY));
                checkPutTx(false, concurrency, isolation, keyForNode(grid(1).localNode(), PRIMARY), keyForNode(grid(1).localNode(), PRIMARY), keyForNode(grid(1).localNode(), PRIMARY));
            }
        }
    }
}
Also used : TransactionConcurrency(org.apache.ignite.transactions.TransactionConcurrency) TransactionIsolation(org.apache.ignite.transactions.TransactionIsolation)

Aggregations

TransactionIsolation (org.apache.ignite.transactions.TransactionIsolation)52 TransactionConcurrency (org.apache.ignite.transactions.TransactionConcurrency)48 Transaction (org.apache.ignite.transactions.Transaction)29 Ignite (org.apache.ignite.Ignite)21 IgniteTransactions (org.apache.ignite.IgniteTransactions)10 IgniteCache (org.apache.ignite.IgniteCache)7 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)5 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 HashMap (java.util.HashMap)4 ArrayList (java.util.ArrayList)3 IgniteException (org.apache.ignite.IgniteException)3 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)3 HashSet (java.util.HashSet)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 CacheException (javax.cache.CacheException)2 Transaction (javax.transaction.Transaction)2 TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)2 IgniteEx (org.apache.ignite.internal.IgniteEx)2