Class ReadThroughCachingAttachmentDao

java.lang.Object
com.atlassian.confluence.pages.attachments.AbstractDelegatingAttachmentDao
com.atlassian.confluence.impl.pages.attachments.ReadThroughCachingAttachmentDao
All Implemented Interfaces:
AttachmentDaoInternal, DelegatingAttachmentDao, AttachmentDao, FlushableCachingDao

public class ReadThroughCachingAttachmentDao extends AbstractDelegatingAttachmentDao implements FlushableCachingDao
Caches the IDs of attachments retrieved with getLatestAttachment(ContentEntityObject, String) in a cache. Other methods simply delegate to the underlying DAO.

Because the persistent ID of the latest version of an attachment never changes, there's no need to synchronise the cache when an attachment is modified. However, the cache is updated when attachments are removed through this interface.

If for some reason the cache does get out of sync with the database, the lookup using the cached ID will fail. In this situation, we fall back to using the lookup by content ID + file name.

Will also cache misses.

Since:
7.5