title: Is "transaction.atomic" same as "transaction.commit_on_success"?
body: <p>Django 1.6 proposes <code>@transaction.atomic</code> as part of the rehaul in the transaction management from 1.5.</p>
  <p>I have a function which is called by a Django management command which is in turn called by cron, i.e. no HTTP request triggering transactions in this case. Snippet:</p>
  <pre><code>from django.db import transaction
  
  @transaction.commit_on_success
  def my_function():
      # code here
  </code></pre>
  <p>In the above code block <a href="https://docs.djangoproject.com/en/1.6/topics/db/transactions/#django.db.transaction.commit_on_success" rel="nofollow noreferrer"><code>commit_on_success</code></a> uses a single transaction for all the work done in <code>my_function</code>.</p>
  <p>Does replacing <code>@transaction.commit_on_success</code> with <code>@transaction.atomic</code> result in the identical behaviour? <code>@transaction.atomic</code> <a href="https://docs.djangoproject.com/en/3.0/topics/db/transactions/#django.db.transaction.atomic" rel="nofollow noreferrer">docs state</a>:</p>
  <blockquote>
  <p>Atomicity is the defining property of database transactions. atomic
  allows us to create a block of code within which the atomicity on the
  database is guaranteed. If the block of code is successfully
  completed, the changes are committed to the database. If there is an
  exception, the changes are rolled back.</p>
  </blockquote>
  <p>I take it that they result in the same behaviour; correct?</p>