0 Replies Latest reply on Apr 5, 2005 4:49 AM by Terry Paterson

    CMP .remove() not updating related CMRs

    Terry Paterson Newbie

      JBoss 3.2.6 & 3.2.7, CMP, CMT, Postgres DB

      I have two tables (salesorderdetail, lock), salesorderdetail has a lock_id column which is a foreign key into the lock table, and I have two corresponding entitys (salesorderdetail, lock) one of which has a CMR into the other

      SalesOrderDetailBean.java :
       * This is a uni-directional one-to-many relationship CMR method
       * @return the related com.actual_systems.p2.server.entity.interfaces.LockLocal.
       * @ejb.interface-method view-type="local"
       * @ejb.relation name="lock-cmp20-salesorderdetail-cmp20"
       * role-name="salesorderdetail-cmp20-has-lock-cmp20"
       * target-ejb="Lock"
       * target-role-name="lock-cmp20-has-salesorderdetail-cmp20"
       * target-multiple="yes"
       * @jboss.relation-mapping style="foreign-key"
       * @jboss.relation fk-constraint="true"
       * fk-column="lock_id"
       * related-pk-field="lockId"
       * @ejb.value-object aggregate="com.actual_systems.p2.shared.values.generated.LockLightValue"
       * aggregate-name="Lock"
       * match="all"
       * relation="external"
       public LockLocal getLock();

      most of the time if I find a lock and invoke it's remove() method, all of the lockIds in salesorderdetail get cleaned up (set to null).

      however - recently I've had several cases where there are multiple salesorderdetail entitys with the same lockId, but when I attempt to remove the associated lock -- JBoss only attempts to update one of the salesorderdetail entitys.

      I know that JBoss is only updating one of the entitys since I've turned up the ..plugins.cmp logging in my log4.xml file - and can see the SQL to be executed..

      Anyone seen this before ?

      Is there any fix for it ?