title: GAE writing information to datastore is causing duplicate writes
body: <p>I have an app which holds a quiz every weekend. Basically I send questions to my users using GCM and they can reply by selecting the correct answer option in the app. These answers are then stored in the datastore in the form of entities.</p>
  
  <p>I have a function to write the phone number and answer (correct/incorrect )to the datastore -</p>
  
  <pre><code>  public static void SaveQuizAnswers(String phoneNumberSave, String Answer){
        Transaction txn = datastore.beginTransaction();
          try {
            Entity entity = new Entity(QUIZ);
            entity.setProperty(PHONE_NO, phoneNumberSave);
            entity.setProperty(ANSWER, Answer);
            datastore.put(entity);
            txn.commit();
          } finally {
            if (txn.isActive()) {
              txn.rollback();
            }
          }     
    }
  </code></pre>
  
  <p>This function is called by the code below - </p>
  
  <pre><code>String Answer = req.getParameter("Answer");
  String phoneNumberSave = req.getParameter("phoneNumber");
  Datastore.SaveQuizAnswers(phoneNumberSave, Answer);
  </code></pre>
  
  <p>The issue is that I can see multiple responses written for the same user. I have tried making <code>&lt;threadsafe&gt;false&lt;/threadsafe&gt;</code> so that App engine ensures single requests being served by an instance but I still see duplicates. So, for example if I have sent 5 questions to multiple users, then for every user there should not be more than 5 responses, but this is not the case and I see 7 or 8 responses per user. What is causing this? I have checked the app and the code is fine there. Is there any modification required in the above code. Appreciate your help.</p>