It is so strange. I met an inactive transaction error with batch insertion and deletion before. But when I do the batch updating within onupgradeneeded, I don't found it. The next version of this patch will be in batch mode.