Only use sql transactions for tag cache

Since transactions cannot nest.