Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13170

Java thin client: Transactions functionality withLabel is broken

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9
    • Component/s: thin client
    • Labels:
      None
    • Ignite Flags:
      Release Notes Required

      Description

      Reproducer

      @Test
      public void testTransactions1() throws Exception {
          try (Ignite ignite = Ignition.start(Config.getServerConfiguration());
               IgniteClient client = Ignition.startClient(getClientConfiguration()))
          {
              ClientCache<Integer, String> cache = client.createCache(new ClientCacheConfiguration()
                      .setName("cache")
                      .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));
      
              cache.put(1, "value1");
      
              try (ClientTransaction tx = client.transactions().withLabel("asdasda").txStart()) {
                  cache.put(1, "value2");
              }
      
              assertEquals("value1", cache.get(1));
          }
      }
      

      Root cause: a new instance of transactions facade is created when withLabel modificator is used. Transactions are registered in threadLocTxUid map of this instance, but when any cache operation is performed transaction is looked only at root threadLocTxUid map.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex_pl Aleksey Plekhanov
                Reporter:
                alex_pl Aleksey Plekhanov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h