add database transaction to tasks