@Override
  public void putObject(Object key, Object value) {
    try {
      delegate.putObject(key, value);
    } finally {
      releaseLock(key);
    }
  }
Simple blocking decorator 

Sipmle and inefficient version of EhCache's BlockingCache decorator.
It sets a lock over a cache key when the element is not found in cache.
This way, other threads will wait until this element is filled instead of hitting the database.

@author Eduardo Macarron
src/main/java/org/apache/ibatis/cache/decorators/BlockingCache.java