Repository.close() method is used when reference counting and expiration
needs to be honored. The RepositoryCache.unregisterAndCloseRepository
method should close the repository unconditionally. This is also indicated
from its javadoc.
Change-Id: I19392d1eaa17f27ae44b55eea49dcff05a52f298
private void unregisterAndCloseRepository(final Key location,
Repository db) {
synchronized (lockFor(location)) {
- if (isExpired(db)) {
- Repository oldDb = unregisterRepository(location);
- if (oldDb != null) {
- oldDb.close();
- }
+ Repository oldDb = unregisterRepository(location);
+ if (oldDb != null) {
+ oldDb.doClose();
}
}
}