0 Replies Latest reply on Oct 8, 2015 7:10 PM by Daniel Boromisa

    inconsistent behavior with JPA hibernate with Arquillian vs real runtime.

    Daniel Boromisa Newbie

      I am experiencing some rather odd behavior where a specific child record direct delete is not working and forcing me to rewrite source code just to make arquillian happy which seems rather counter productive.

       

      @Entity 
      
      public class Parent {
      
      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "project")
      @SortComparator(ChildRecordSequenceNumberComparator.class)
      private SortedSet<ChildRecord> childRecord;
      }
      
      
      

       

      This is the simple entity.

       

      @Test
      @Transactional
      public void testDeleteChildRecord() {
           childRecord.deleteChildRecord(parent.getChildRecord().first().getId());
           em.flush();
           ChilRecord verificationRecord = childRecord.findById(parent.getChildRecord().first().getId());
           assertTrue(verificationAnswer == null);
      
      }
      
      
      
      

       

      so when I execute this test, I fail every time, but when I run this on server it works like a champ. I tested this with both 1.1.9.Final and 1.1.6.Final. not until I do a cascading update with a removed child record in the source code does arquillian work as expected.

      <dependency>
         <groupId>org.jboss.arquillian</groupId>
         <artifactId>arquillian-bom</artifactId>
         <version>${version.arquillian_core}/version>
         <scope>import</scope>
         <type>pom</type>
      </dependency>