run dbstuff in one big transaction, avoid conflicts