ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veris4crm <veris4...@163.com>
Subject Re: same cache cannot update twice in one transaction
Date Fri, 21 Jul 2017 06:11:27 GMT
Hi,vkulichenko
    Thanks your replying, I had been add tx.close() on my code. 
    "not working" when I update same cache data more than one time on same
transactional, the update will failure because query return cache data still
the old data,not the updated dirty data.

    code is not working in demo project as below:
        // update cache multiple time on one transactional
        igniteTLS.txStart();
        result = testDemo.reservedSku(cacheInfo.getSkuId(), 1);
        //
-----------------------------------------------------------------------
first time to update cache,it is success
        System.out.println(String.format("#2-1 return %d row updated",
result));

        //
-----------------------------------------------------------------------
second time to update cache,it is failure because igniteCache.query return
cache is old data, not the first time update dirty data.
        result = testDemo.reservedSku(cacheInfo.getSkuId(), 2);
        System.out.println(String.format("#2-2 return %d row updated",
result));

      //
-----------------------------------------------------------------------
third time to update cache,it is failure because igniteCache.query return
cache is old data, not the first time update dirty data.
        result = testDemo.reservedSku(cacheInfo.getSkuId(), 3);
        System.out.println(String.format("#2-3 return %d row updated",
result));
        igniteTLS.commit();
   



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/same-cache-cannot-update-twice-in-one-transaction-tp14639p15225.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message