5 Replies Latest reply on Dec 16, 2003 10:31 PM by gorano

    Error removing Entity with cascade delete specified

    thuesler

      Hi

      When trying to remove an CMP2.0 Entity I simply get
      a RemoveException stating "Could not remove entity".

      The entity has several 1.n unidirectional relationships all with cascade delete specified on the db and the deployment descriptor...

      I actually don't know what to do as the error message says hell lot about the problem...

      DB used is IBM DB2 V7.1 on OS390 and JBoss 3.2.1

      Any help would really be appreciated
      -t

        • 1. Also with only cascade delete in the entity model it does no
          thuesler

          Hi

          I now gave it a trial to remove the cascade delete specs on the DB and only having them in the CMP Model. Also this does not work.

          The DB now states a fk constraint violation that there are still child rows existings... Seems to me as the whole cascade delete logic does not work in JBOSS 3.2.1... Anyone having a clou if it is a bug?

          t

          • 2. Re: Also with only cascade delete in the entity model it doe

            Sounds like it is just your database constraints conflicting with what the CMP engine is attempting to do.

            Either specify cascade-delete in the database and don't do it at EJB level or specify it at the EJB level and set the DB constraints to such that the CMP engine is allowed to delete the rows in its own order (which seem to violate your current DB schema referential integrity).

            -- Juha

            • 3. Re: Error removing Entity with cascade delete specified
              thuesler

              With the customer we're having it will be fairly difficult to get the database setup so that application Keys can be set null what seems to violate Jboss...

              So I am actually using the db cascade deletes. But what happens if the JBoss runs in a cluster??? Is it working with db cascade deletes?

              • 4. Re: Error removing Entity with cascade delete specified

                What is the issue with cascade-delete on a cluster? Please explain.

                • 5. Re: Error removing Entity with cascade delete specified
                  gorano

                  My solution was to just disable all my DB-constraints and now JBoss works fine with cascade delete.

                  But to be honest, I think the JBoss implementation of the cascade delete should follow the "common sense" logic to delete the children first and then deal with the parent.

                  But I'm probably wrong ;-) maybe there is some good reasons not to follow the most logical way of dealing with cascade deletes.

                  goodnight

                  Goran