You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running gridgain 6.1.9, I need to load some data from RDBMS to several caches in a transaction via read-through, I wrote a unit test, it doesn't work.
To my understanding, following scenario should work, steps:
one record in DB, no any data in cache
start a transaction
cache.get(key), load data to cache via read-through
rollback transaction
no any data in cache again
Part of the testing code:
JotmJtaTxMgrLookup.beginTransaction();
logger.info("cache.get({}) before rollback, it should be loaded from DB", id);
gotEmployee = cache.get(id);
assertEquals(name, gotEmployee.getName());
Employee employee = new Employee(2L, "test2");
cache.put(2L, employee);
JotmJtaTxMgrLookup.rollbackTransaction();
assertNull(cache.get(2L)); // it's rolled back
logger.info("cache.get({}) after rollback, it should be loaded again from DB", id); // but it doesn't
gotEmployee = cache.get(id);
assertEquals(name, gotEmployee.getName());
I'll push the whole testing project to GitHub if it's necessary.
The text was updated successfully, but these errors were encountered:
I'm running gridgain 6.1.9, I need to load some data from RDBMS to several caches in a transaction via read-through, I wrote a unit test, it doesn't work.
From http://atlassian.gridgain.com/wiki/display/GG619/Pluggable+Persistent+Storage , I found "All read-through and write-through operations will participate in overall cache transaction and will be committed or rolled back as a whole."
To my understanding, following scenario should work, steps:
Part of the testing code:
I'll push the whole testing project to GitHub if it's necessary.
The text was updated successfully, but these errors were encountered: