title: What does google Guava LoadingCache do when a call is made to invalidate while load is executing?
body: <p>I have a Google guava cache that is loading data from the database and caching it using the primary key. The objects I end up creating from the database are immutable and building an object requires access to several tables. What happens in the following scenario:</p>
  
  <ul>
  <li>Thread 1: calls cache.load(10) and the cache is being populated based on a database primary key with value 10</li>
  <li>Thread 2: updates the database row with primary key 10 and so it calls cache.invalidate(10) the invalidate is called before the cache.load(10) is finished.</li>
  </ul>
  
  <p>What does Guava Loading Cache do when invalidate(x) is called while load(x) is executing? </p>