Fix DB transaction with try/finally