more efficient db accesses using transactions