Changed db to @db in transaction