title: one to many relationship in app engine is not working properly when used in android client
body: <p>I am trying to use one to many and many to one relationship in modelling the relationship of student and teacher. When I try to persist teacher with students in android app, teacher and students are persisted but I get the following error. And then when I try to list all students I get the same error.
  Error log on android side:</p>
  
  <pre><code>06-17 10:10:43.394: W/System.err(27823): com.google.api.client.googleapis.json.GoogleJsonResponseException: 503 Service Unavailable
  06-17 10:10:43.399: W/System.err(27823): {
  06-17 10:10:43.399: W/System.err(27823):   "code" : 503,
  06-17 10:10:43.399: W/System.err(27823):   "errors" : [ {
  06-17 10:10:43.399: W/System.err(27823):     "domain" : "global",
  06-17 10:10:43.399: W/System.err(27823):     "message" : "",
  06-17 10:10:43.399: W/System.err(27823):     "reason" : "backendError"
  06-17 10:10:43.399: W/System.err(27823):   } ],
  06-17 10:10:43.399: W/System.err(27823):   "message" : ""
  06-17 10:10:43.399: W/System.err(27823): }
  06-17 10:10:43.399: W/System.err(27823):    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
  06-17 10:10:43.399: W/System.err(27823):    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
  06-17 10:10:43.399: W/System.err(27823):    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:312)
  06-17 10:10:43.404: W/System.err(27823):    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1045)
  06-17 10:10:43.404: W/System.err(27823):    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
  06-17 10:10:43.404: W/System.err(27823):    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
  06-17 10:10:43.404: W/System.err(27823):    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
  06-17 10:10:43.404: W/System.err(27823):    at com.schoolhydra.MainActivity$SendInfo.doInBackground(MainActivity.java:96)
  06-17 10:10:43.404: W/System.err(27823):    at com.schoolhydra.MainActivity$SendInfo.doInBackground(MainActivity.java:1)
  06-17 10:10:43.404: W/System.err(27823):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
  06-17 10:10:43.404: W/System.err(27823):    at java.util.concurrent.FutureTask.run(FutureTask.java:234)
  06-17 10:10:43.404: W/System.err(27823):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
  06-17 10:10:43.404: W/System.err(27823):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
  06-17 10:10:43.404: W/System.err(27823):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
  06-17 10:10:43.404: W/System.err(27823):    at java.lang.Thread.run(Thread.java:841)
  </code></pre>
  
  <p>Error log on server side:</p>
  
  <pre><code>Uncaught exception from servlet
  java.io.IOException: com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: Unable to get a resource (through reference chain: com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;com.schoolhydra.Teacher["students"]-&gt;java.util.ArrayList[0]-&gt;com.schoolhydra.Student["teacher"]-&gt;c...(length 618733)
  </code></pre>
  
  <p>and warning, which came up with error:</p>
  
  <pre><code>com.google.appengine.datanucleus.MetaDataValidator warn: Meta-data warning for com.schoolhydra.Student.teacher: Error in meta-data for com.schoolhydra.Student.teacher : The datastore does not support joins and therefore cannot honor requests to place related objects in the default fetch group.  The field will be fetched lazily on first access.  You can modify this warning by setting the datanucleus.appengine.ignorableMetaDataBehavior property in your config.  A value of NONE will silence the warning.  A value of ERROR will turn the warning into an exception.
  </code></pre>
  
  <p>Teacher class</p>
  
  <pre><code>@Entity
  public class Teacher {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Key id;
  
      private String name;
      private String surname;
  
      @OneToMany(mappedBy = "teacher", cascade = CascadeType.ALL)
      private List&lt;Student&gt; students = new ArrayList&lt;Student&gt;();
  
      public Key getId() {
          return id;
      }
      public void setId(Key id) {
          this.id = id;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
      public String getSurname() {
          return surname;
      }
      public void setSurname(String surname) {
          this.surname = surname;
      }
      public List&lt;Student&gt; getStudents() {
          return students;
      }
      public void setStudents(List&lt;Student&gt; students) {
          this.students = students;
      }
  
  }
  </code></pre>
  
  <p>Student class</p>
  
  <pre><code>@Entity
  public class Student {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Key id;
      private String name;
      private String surname;
  
      @ManyToOne
      private Teacher teacher;
  
      public Key getId() {
          return id;
      }
      public void setId(Key id) {
          this.id = id;
      }
      public String getName() {
          return name;
      }
      public void setName(String name) {
          this.name = name;
      }
      public String getSurname() {
          return surname;
      }
      public void setSurname(String surname) {
          this.surname = surname;
      }
      public Teacher getTeacher() {
          return teacher;
      }
      public void setTeacher(Teacher teacher) {
          this.teacher = teacher;
      }
  
  }
  </code></pre>
  
  <p>it seems that problem arises when I use mappedBy in @OneToMany. I am using datastore as databse. Is there some restriction, that datastore does not support mappedBy, because it is not relational database?</p>
  
  <p>Can anyone help me with this problem?</p>