1 Reply Latest reply on Apr 9, 2005 1:50 PM by epbernard

    Problems with preview 5

    mauburn

      I've noticed two problems so far in working with preview 5:
      1) CascadeType.REMOVE doesn't work
      2) It appears that preview 5 is incompatible with the jboss-cache.jar supplied in 4.0.1sp1


      About 1): I have an association declared as:
      @ManyToMany(cascade={CascadeType.REMOVE}, fetch = FetchType.LAZY)
      @AssociationTable(
      table=@Table(name="DATA_ELEMENT_VALUE_ASSNS"),
      joinColumns={@JoinColumn(name="CONTEXT_VALUE_ID")},
      inverseJoinColumns = {@JoinColumn(name="VALUE_ID")}
      )
      @org.hibernate.annotations.Cache(usage = org.hibernate.annotations.CacheConcurrencyStrategy.TRANSACTIONAL)
      private Set<Value3> scalarValues = new HashSet<Value3>();

      While it compiles fine, at deployment time I get the error:

      2005-04-08 12:05:55,191 ERROR [jboss.j2ee:service=EJB3,module=portblue.ejb3 Ejb3Module] Ejb3Module:jbossInternalStart- Starting failed jboss.j2ee:service=EJB3,module=portblue.ejb3
      org.hibernate.MappingException: Unsupported cascade style: remove
      at org.hibernate.engine.Cascades.getCascadeStyle(Cascades.java:961)
      at org.hibernate.mapping.Property.getCascadeStyle(Property.java:92)

      I changed the CascadeType to ALL and it works, but it's not what I need. I also looked through the test suite in jboss-head for ejb3 and didn't see any references to CascadeType.REMOVE, so perhaps it's really a bug.



      About 2): I'm using a second-level Hibernate cache using TreeCache (with READ_COMMITTED) and if I use the standard 4.0.1sp1 jboss-cache.jar, I get the following exceptions once I start to use the cache:

      Caused by: javax.transaction.TransactionRolledbackException: org.jboss.cache.TreeCache.putFailFast(Lorg/jboss/cache/Fqn;Ljava/lang/Object;Ljava/lang/Object;J)Ljava/lang/Object;; nested exception is:
      java.lang.NoSuchMethodError: org.jboss.cache.TreeCache.putFailFast(Lorg/jboss/cache/Fqn;Ljava/lang/Object;Ljava/lang/Object;J)Ljava/lang/Object;
      at
      ...
      Caused by: java.lang.NoSuchMethodError: org.jboss.cache.TreeCache.putFailFast(Lorg/jboss/cache/Fqn;Ljava/lang/Object;Ljava/lang/Object;J)Ljava/lang/Object;
      at org.hibernate.cache.TreeCache.put(TreeCache.java:58)
      at org.hibernate.cache.TransactionalCache.put(TransactionalCache.java:50)
      at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:126)
      at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:492)
      at org.hibernate.loader.Loader.doQuery(Loader.java:411)

      When I replaced the jboss-cache.jar with a version that I created from jboss-head CVS tree, it appears to mostly work - except that when I do some complicated nested transactions I get some really weird behaviour: my app sees duplicate values in the cache and the cache reports cache inconsistency errors such as:

      2005-04-08 14:21:54,659 WARN [christian.gihep] TreeCache:_remove- node ///com.portblue.model.usage.clientvalue.Value3.contextCoordinateValues#406402261 not found

      and I'm not sure whether to ascribe those errors to a problem with my app or to a version mismatch problem in the odd way I've configured JBoss.

      Help! Thanks...

      P.S. I've got the Hibernate annotations for second-level caching coexisting with standard EJB3.0 annotations - very cool!

      - Mark

        • 1. Re: Problems with preview 5
          epbernard

           

          "mauburn" wrote:
          I changed the CascadeType to ALL and it works, but it's not what I need. I also looked through the test suite in jboss-head for ejb3 and didn't see any references to CascadeType.REMOVE, so perhaps it's really a bug.

          Correct this is a bug I introduced in the last Hibernate Annotations release. I've added a test suite (and the fix) in HA to cover that one.