title: Different Persistance Behaviour with In-Memory and MySQL DB
body: <p>I have a parent entity and a child entity with a one to many relationship.</p>
  
  <p>When using @DataJpaTest (i.e. configuring an in memory database), the following works as expected:</p>
  
  <pre><code>LOG.info("Creating stops");
  Stop stop1 = new Stop(new Time(0), "Acton Town", new HashSet&lt;&gt;());
  Set&lt;Stop&gt; stops = new HashSet&lt;&gt;();
  stops.add(stop1);
  
  LOG.info("Creating and persisting routes");
  Route route = routeRepository.save(new Route("something", "return"));
  
  LOG.info("Adding stops to route");
  stops.forEach(route::addStop);
  </code></pre>
  
  <p>It inserts the route and each child correctly, and I can fetch the route later and get the same information back.</p>
  
  <p>However, when I repeat this in my service while using a real datasource (a local MySQL DB), the CASCADE.ALL persist does not seem to occur, and I end up with no inserts for the stops but the route is persisted and assigned an ID.</p>
  
  <p>I've followed the advice from around the site by using an 'addEntity' method in the parent that configured the bidirectional relationship, but it doesn't work outside of the test suite.</p>
  
  <p>Does anyone know why this might be?</p>