      # open a transaction
      @transaction.atomic
      def viewfunc(request):
  
        a.save()
        # transaction now contains a.save()
  
        sid = transaction.savepoint()
  
        b.save()
        # transaction now contains a.save() and b.save()
 
</s> remove       b.save()
      # transaction now contains a.save() and b.save()
 </s> add         b.save()
        # transaction now contains a.save() and b.save() </s> remove       sid = transaction.savepoint()
 </s> add         sid = transaction.savepoint() </s> remove       if want_to_keep_b:
          transaction.savepoint_commit(sid)
          # open transaction still contains a.save() and b.save()
      else:
          transaction.savepoint_rollback(sid)
          # open transaction now contains only a.save()
 </s> add         if want_to_keep_b:
            transaction.savepoint_commit(sid)
            # open transaction still contains a.save() and b.save()
        else:
            transaction.savepoint_rollback(sid)
            # open transaction now contains only a.save() </s> remove .. versionchanged:: 1.5

 </s> add  </s> remove You can now use :class:`HttpResponse` as a file-like object even if it was
instantiated with an iterator. Django will consume and save the content of
the iterator on first access.
 </s> add     You can now use :class:`HttpResponse` as a file-like object even if it was
    instantiated with an iterator. Django will consume and save the content of
    the iterator on first access.
        a.save()
        # transaction now contains a.save()
      # open a transaction
      @transaction.atomic
      def viewfunc(request):
  
        a.save()
        # transaction now contains a.save()
        a.save()
        # transaction now contains a.save()
  
        sid = transaction.savepoint()
  
        b.save()
        # transaction now contains a.save() and b.save()
keep keep keep keep replace replace keep keep keep keep keep
 Adapted uses of versionchanged/versionadded to the new form.

Refs #20104. 
docs/topics/db/transactions.txt