// Not read-only transactions
txTemplate.setReadOnly(false);
for (final Long activityId : uncomputedActivityIds) {
txTemplate.execute(new TransactionCallbackWithoutResult() {
public void doInTransaction() {
Activity activity = Activity.findById(activityId);
activity.computeBadges(context);
}
});