Codota Logo
IgniteInternalCache.txStartEx
Code IndexAdd Codota to your IDE (free)

How to use
txStartEx
method
in
org.apache.ignite.internal.processors.cache.IgniteInternalCache

Best Java code snippets using org.apache.ignite.internal.processors.cache.IgniteInternalCache.txStartEx (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: apache/ignite

/**
 * Start transaction on meta cache.
 *
 * @return Transaction.
 */
private GridNearTxLocal startTx() {
  return metaCache.txStartEx(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
}
origin: apache/ignite

/** {@inheritDoc} */
@Override public GridNearTxLocal txStartEx(
  TransactionConcurrency concurrency,
  TransactionIsolation isolation
) {
  return delegate.get().txStartEx(concurrency, isolation);
}
origin: apache/ignite

/** {@inheritDoc} */
@Override public GridNearTxLocal txStartEx(TransactionConcurrency concurrency, TransactionIsolation isolation) {
  CacheOperationContext prev = gate.enter(opCtx);
  try {
    return delegate.txStartEx(concurrency, isolation);
  }
  finally {
    gate.leave(prev);
  }
}
origin: apache/ignite

/**
 * @param ctx Context.
 * @param prj Projection.
 * @param concurrency Concurrency.
 * @param isolation Isolation.
 * @return New transaction.
 */
public static GridNearTxLocal txStartInternal(GridCacheContext ctx, IgniteInternalCache prj,
  TransactionConcurrency concurrency, TransactionIsolation isolation) {
  assert ctx != null;
  assert prj != null;
  ctx.tm().resetContext();
  return prj.txStartEx(concurrency, isolation);
}
origin: apache/ignite

/**
 * Execute closure inside cache transaction.
 *
 * @param cache Cache.
 * @param concurrency Concurrency.
 * @param isolation Isolation.
 * @param clo Closure.
 * @throws IgniteCheckedException If failed.
 */
public static <K, V> void inTx(IgniteInternalCache<K, V> cache, TransactionConcurrency concurrency,
  TransactionIsolation isolation, IgniteInClosureX<IgniteInternalCache<K ,V>> clo) throws IgniteCheckedException {
  try (GridNearTxLocal tx = cache.txStartEx(concurrency, isolation)) {
    clo.applyx(cache);
    tx.commit();
  }
}
origin: apache/ignite

  nodes = null;
try (GridNearTxLocal tx = cache.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
  GridServiceAssignmentsKey key = new GridServiceAssignmentsKey(cfg.getName());
origin: apache/ignite

while(true) {
  try {
    try (GridNearTxLocal tx = cache.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
      AtomicDataStructureValue val = cache.get(key);
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testGridNearTxLocalDuplicateAsyncCommit() throws Exception {
  IgniteKernal ignite = (IgniteKernal)grid(0);
  IgniteInternalCache<Object, Object> utilityCache = ignite.context().cache().utilityCache();
  try (GridNearTxLocal itx = MvccFeatureChecker.forcedMvcc() ?
    utilityCache.txStartEx(PESSIMISTIC, REPEATABLE_READ) :
    utilityCache.txStartEx(OPTIMISTIC, SERIALIZABLE)) {
    utilityCache.put("1", "1");
    itx.commitNearTxLocalAsync();
    itx.commitNearTxLocalAsync().get();
  }
}
origin: apache/ignite

  colocatedKey.evictExclude(), colocatedKey.blockId());
try (GridNearTxLocal tx = dataCachePrj.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
origin: apache/ignite

@Override public T applyx() throws IgniteCheckedException {
  cache.context().gate().enter();
  try (GridNearTxLocal tx = cache.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
    AtomicDataStructureValue val = cache.get(key);
origin: apache/ignite

try (GridNearTxLocal tx = dataCachePrj.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
  Map<IgfsBlockKey, byte[]> vals = dataCachePrj.getAll(F.asList(colocatedKey, key));
origin: apache/ignite

/**
 * @throws Exception If failed.
 */
@Test
public void testSystemTxInsideUserTx() throws Exception {
  Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10473", MvccFeatureChecker.forcedMvcc());
  IgniteKernal ignite = (IgniteKernal)grid(0);
  IgniteCache<Object, Object> jcache = ignite.cache(DEFAULT_CACHE_NAME);
  try (Transaction tx = ignite.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
    jcache.get("1");
    jcache.put("1", "11");
    IgniteInternalCache<Object, Object> utilityCache = ignite.context().cache().utilityCache();
    utilityCache.getAndPutIfAbsent("2", "2");
    try (GridNearTxLocal itx = utilityCache.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
      assertEquals(null, utilityCache.get("1"));
      assertEquals("2", utilityCache.get("2"));
      assertEquals(null, utilityCache.get("3"));
      utilityCache.getAndPut("3", "3");
      itx.commit();
    }
    jcache.put("2", "22");
    tx.commit();
  }
  checkTransactionsCommitted();
  checkEntries(DEFAULT_CACHE_NAME, "1", "11", "2", "22", "3", null);
  checkEntries(CU.UTILITY_CACHE_NAME, "1", null, "2", "2", "3", "3");
}
origin: org.apache.ignite/ignite-core

/**
 * Start transaction on meta cache.
 *
 * @return Transaction.
 */
private GridNearTxLocal startTx() {
  return metaCache.txStartEx(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ);
}
origin: org.apache.ignite/ignite-core

/** {@inheritDoc} */
@Override public GridNearTxLocal txStartEx(TransactionConcurrency concurrency, TransactionIsolation isolation) {
  CacheOperationContext prev = gate.enter(opCtx);
  try {
    return delegate.txStartEx(concurrency, isolation);
  }
  finally {
    gate.leave(prev);
  }
}
origin: org.apache.ignite/ignite-core

/**
 * @param ctx Context.
 * @param prj Projection.
 * @param concurrency Concurrency.
 * @param isolation Isolation.
 * @return New transaction.
 */
public static GridNearTxLocal txStartInternal(GridCacheContext ctx, IgniteInternalCache prj,
  TransactionConcurrency concurrency, TransactionIsolation isolation) {
  assert ctx != null;
  assert prj != null;
  ctx.tm().resetContext();
  return prj.txStartEx(concurrency, isolation);
}
origin: org.apache.ignite/ignite-core

/**
 * Execute closure inside cache transaction.
 *
 * @param cache Cache.
 * @param concurrency Concurrency.
 * @param isolation Isolation.
 * @param clo Closure.
 * @throws IgniteCheckedException If failed.
 */
public static <K, V> void inTx(IgniteInternalCache<K, V> cache, TransactionConcurrency concurrency,
  TransactionIsolation isolation, IgniteInClosureX<IgniteInternalCache<K ,V>> clo) throws IgniteCheckedException {
  try (GridNearTxLocal tx = cache.txStartEx(concurrency, isolation)) {
    clo.applyx(cache);
    tx.commit();
  }
}
origin: org.apache.ignite/ignite-core

while(true) {
  try {
    try (GridNearTxLocal tx = cache.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
      AtomicDataStructureValue val = cache.get(key);
origin: org.apache.ignite/ignite-core

  colocatedKey.evictExclude(), colocatedKey.blockId());
try (GridNearTxLocal tx = dataCachePrj.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
origin: org.apache.ignite/ignite-core

@Override public T applyx() throws IgniteCheckedException {
  cache.context().gate().enter();
  try (GridNearTxLocal tx = cache.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
    AtomicDataStructureValue val = cache.get(key);
origin: org.apache.ignite/ignite-core

try (GridNearTxLocal tx = dataCachePrj.txStartEx(PESSIMISTIC, REPEATABLE_READ)) {
  Map<IgfsBlockKey, byte[]> vals = dataCachePrj.getAll(F.asList(colocatedKey, key));
org.apache.ignite.internal.processors.cacheIgniteInternalCachetxStartEx

Popular methods of IgniteInternalCache

  • context
  • get
    Retrieves value mapped to the specified key from cache. Value will only be returned if its entry pas
  • affinity
    Gets affinity service to provide information about data partitioning and distribution.
  • configuration
    Gets configuration bean for this cache.
  • containsKey
  • getAndPut
    Stores given key-value pair in cache. If filters are provided, then entries will be stored in cache
  • getAndPutIfAbsent
    Stores given key-value pair in cache only if cache had no previous mapping for it. If cache previous
  • invoke
  • invokeAsync
  • put
    Stores given key-value pair in cache. If filters are provided, then entries will be stored in cache
  • size
  • cache
    Gets base cache for this projection.
  • size,
  • cache,
  • clear,
  • clearLocallyAll,
  • isEmpty,
  • isIgfsDataCache,
  • keySet,
  • localEntries,
  • localPeek,
  • lock

Popular in Java

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Notification (javax.management)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now