• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Fixed
  • alexsnaps
  • Reporter: alexsnaps
  • June 01, 2011
  • 0
  • Watchers: 0
  • July 27, 2012
  • July 14, 2011

Description

Since transactional caches can only be accessed from within a transaction, getWithLoader will always fail:

  • Not only is the call delegated to the Executor using a Future;
  • But the put to the cache happens from that thread, not leaving any hooks for the transaction to be committed (as it’s after the CacheLoader.load() method call implemented by the user).

So there is no way of using CacheLoaders with transactional caches See http://forums.terracotta.org/forums/posts/list/5497.page

Comments

Fiona OShea 2011-06-14

I’m not sure of the priority for working on this. Leaving assigned to DRB for review by Mike and Steve.

Fiona OShea 2011-06-21

How hard is this to fix. Comment on estimated time to resolve.

We can target to Ulloa - if you think it is possible for then let us know

Alexander Snaps 2011-06-27

Fixing shouldn’t be hard, just need to make sure the put() does happen on the same thread as the the get() method call is. Either by having the some future like returning the actual value, or simply not doing any work on a different thread… Should be a pretty straight forward refactoring. We certainly can get this done as part of Ulloa.

Alexander Snaps 2011-07-12

Started a code review on my proposed fix: CR-291 I have a small issue with the different behavior in JTA env where loading form the underlying SoR might be part of the transaction. In such cases, having a timeout on the load would also mean a different thread (and hence transaction) for the loading…

Alexander Snaps 2011-07-14

Fixed