MountainClimb / datanucleus-appengine

Automatically exported from code.google.com/p/datanucleus-appengine
0 stars 0 forks source link

CascadeType.ALL on ManyToOne causes StackOverflow #178

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Original report here:
http://code.google.com/p/googleappengine/issues/detail?id=2541

Pretty easy to repro:
  @Entity
  public static class UserImpl {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Key key;

    @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, 
mappedBy = "user")
    private List<TagsRIEImpl> tagRIEs = new LinkedList<TagsRIEImpl>();

    public UserImpl() {
      this.tagRIEs.add(new TagsRIEImpl());
    }

    public Key getKey() {
      return key;
    }
  }

  @Entity
  public static class TagsRIEImpl {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Key key;

    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    private UserImpl user;
  }

  public void testDelete() throws Exception {
    UserImpl user = new UserImpl();
    beginTxn();
    em.persist(user);
    commitTxn();
    em.close();
    em = emf.createEntityManager();
    beginTxn();
    user = em.find(UserImpl.class, user.getKey());
    em.remove(user);
    commitTxn();
    em.close();
  }

Original issue reported on code.google.com by max.r...@gmail.com on 23 Dec 2009 at 9:42

GoogleCodeExporter commented 8 years ago
Confirmed the same problem with DataNucleus 1.1.5 RDBMS (hsql).  I'll see if I 
can repro 
with datanuc trunk.

Original comment by max.r...@gmail.com on 24 Dec 2009 at 9:34

GoogleCodeExporter commented 8 years ago
Confirmed the same issue with datanuc trunk.  I'll file a bug over there.

Original comment by max.r...@gmail.com on 24 Dec 2009 at 11:06

GoogleCodeExporter commented 8 years ago
DataNucleus issue filed:
http://www.jpox.org/servlet/jira/browse/NUCCORE-435

Even if it gets fixed immediately it won't be accessible in GAE until we 
upgrade to 
DataNuc 2.0 which is still a little ways off.

Original comment by max.r...@gmail.com on 25 Dec 2009 at 12:12

GoogleCodeExporter commented 8 years ago
DataNucleus issue filed:
http://www.jpox.org/servlet/jira/browse/NUCCORE-435

Even if it gets fixed immediately it won't be accessible in GAE until we 
upgrade to 
DataNuc 2.0 which is still a little ways off.

Original comment by max.r...@gmail.com on 25 Dec 2009 at 12:16

GoogleCodeExporter commented 8 years ago
Marking as fixed since SVN trunk uses DN3.x

Original comment by googleco...@yahoo.co.uk on 15 Jul 2011 at 12:51