public async ValueTask InsertAsync(ThumbnailCache entity)
        {
            await Task.Delay(1).ConfigureAwait(false);

            using (await _asyncLock.LockAsync())
            {
                var id = new ThumbnailCacheIdEntity()
                {
                    FilePath            = NestedPathEntity.Import(entity.FileMeta.Path),
                    ThumbnailWidth      = (int)entity.ThumbnailMeta.Width,
                    ThumbnailHeight     = (int)entity.ThumbnailMeta.Height,
                    ThumbnailResizeType = entity.ThumbnailMeta.ResizeType,
                    ThumbnailFormatType = entity.ThumbnailMeta.FormatType,
                };
                var storage = this.GetStorage();

                if (!_database.BeginTrans())
                {
                    _logger.Error("current thread already in a transaction");
                    throw new Exception();
                }

                try
                {
                    using (var outStream = storage.OpenWrite(id, "-"))
                    {
                        RocketMessage.ToStream(entity, outStream);
                    }

                    if (!_database.Commit())
                    {
                        _logger.Error("failed to commit");
                        throw new Exception();
                    }
                }
                catch (Exception e)
                {
                    _logger.Debug(e);
                    _database.Rollback();
                }
            }
        }