title: Could anyone tell me about the lazy loading and transaction of django?
body: <h2>background like this:</h2>
  
  <pre><code>data = User.objects.get(pk=1) 
  if data.age &gt; 20:
      with transaction.atomic():
          data.age -=2
          data.save()
  </code></pre>
  
  <p>I want to know ,if many process do the code at the same time,it like that,each process would get the data at the same time without transaction,for example ,age is 30.</p>
  
  <p>then,one process do the next,make age-2=28 and save.</p>
  
  <p>Then the next process do,when it do data.age -=2 ,the data get by data.</p>
  
  <p>age ,would be 18 or 20? If it is 20,did it means,the transaction add the wrong place? Or it means , the transaction would not work,because the transaction would add to the data do select lines,and can change and save.but the transaction add with out select line?</p>
  
  <h2>second question:</h2>
  
  <p>if I do like this:</p>
  
  <pre><code>data = User.objects.get(pk=1)
  with transaction.atomic():
      if data.age &gt; 20:
          data.age -=2
          data.save()
  </code></pre>
  
  <p>this demo,add the transaction before the data.age > 20.
  For the lazy loading,the sql lines would do when I use it ,such as data.age > 20.
  But when it readly do sql lines,the transction had add before.
  So, I want to know,did this demo would add transaction on sql lines?</p>
  
  <p>thanks a lot,nice people.</p>