Closed GoogleCodeExporter closed 9 years ago
Original comment by fry@google.com
on 22 Mar 2013 at 11:08
Issue 1490 has been merged into this issue.
Original comment by cgdecker@google.com
on 2 Aug 2013 at 9:19
Just my two cents, async caches are traps for (especially database related)
deadlocks.
Let's say you use the cache for an expensive db object, and you want to
retrieve that object while in another transaction. If you were using a regular
cache, there will be only one thread and caller is responsible to pass the
transaction to the cache-loading function. But, I guess, async cache will use
seperate thread to retrieve the object and that thread will need its own
transaction. Under stress, DB connection pool will be exhausted, and async
cache's thread will wait forever for an available connection, which is being
held by the caller's thread, which waits for the async cache to return, hence
the deadlock. Which, by the way, cannot be detected by JConsole, at least with
C3P0 as pool implementation.
ListenableFuture.addListener() might be the recommended way to use async cache
but would hurt its practical use.
Original comment by bahri.ge...@gmail.com
on 13 Dec 2013 at 8:56
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:18
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
cpov...@google.com
on 21 Mar 2013 at 3:23