title: django transaction atomc decorator, class view
body: <p>I have a several class based views.  </p>
  
  <p>In one of them, let's say View1 which may call other view to return the response.</p>
  
  <p>so I have something like this:</p>
  
  <pre><code>class View1(View):
    def post(self, request, *args, **kwargs):
       # Some logic ...
       return View2.as_view()(request) # There are more lines like this calling to other views.
  </code></pre>
  
  <p>So <code>View1</code> is somewhat a route view. Based on some conditions, it pass the request to other view to return the response. </p>
  
  <p>I want to use the <code>transaction.atomic</code> decorator on <code>View1</code>, will the atomic transaction apply to all the views that I call? i.e the call to other views won't cancel the atomic request?</p>
  
  <p>So far I used the following methods to decorate View1:  </p>
  
  <ul>
  <li>wrap the view in <code>transaction.atomic</code> in the urls.  </li>
  <li>Used the <code>@method_decorator(transaction.atomic)</code> on the <code>post()</code> method of <code>View1</code>.</li>
  </ul>
  
  <p>The issue is, using any of the two ways to set the view as atomic, even though View1 return with error (exception) "View1 didn't return HttpResponse..", objects are still getting created.</p>
  
  <p>Why?</p>