Discussions

EJB design: Deleting database rows outside of AppServer ???

  1. Deleting database rows outside of AppServer ??? (1 messages)


    I'm using CMP to handle my entity beans. We have a USER table that has a fair bit of dependencies on it. (ie. tables with foreign keys to USER) What is the best approach when deleting a user bean?

    1) Delete the entry in USER table using our User bean and let the database take care of cleaning up all of the dependant entries in the other tables. I'm not sure if the entity beans are being pooled by the AppServer so I don't know if this is even feasible.

    2) Manually delete each dependant bean and then delete the User bean within a single transaction.


    Yvon Lavoie
  2. Well, if you want to be sure about it, then delete the beans themselves, as you suggest in option 2.

    Floyd