removing 'n' rows together with ejbRemove


EJB design: removing 'n' rows together with ejbRemove

  1. removing 'n' rows together with ejbRemove (1 messages)


    I'm writing a BMP entity beans and have a small question.
    There is two tables with the relation of 1 to n, and by removing 1 row in table A I have to remove n rows on table B.
    there is a fast way to remove all the n rows on table B instead of calling n times to ejbRemove?
    Is edit the ejbRemove of table B to "delete from tableB where ID = id and fkID = fkid" is a good solution?
    does this new ejbRemove will remove all the entity and not only the n rows in table B.

    thanks in advance,

    Eitan Fux
  2. I think you need concurrency control in this scenario, since you donot involve the EJB representing those 8 rows in the remove transaction... components / users accessing those EJB's in parallel could request actions which are no longer legal... but generally you should be Ok with this sort of a thing