Originally posted by David Harkness:
It's been a while since I tested it out, but IIRC it's even smarter (at least WebLogic is): it issues a delete on the child table where the FK equals the parent's PK. For example, with User 1:N Address, it does "delete address where user_id = <User.id>". There's no point in loading the beans or going through the home interface for each related entity.
Originally posted by karthik Guru:
Then what it means is that ejbRemove() etc would not be called for the rest of the related beans since they are not even getting loaded in the first place.
Which version of weblogic did you check ?
I installed spy database wrapper
on my machine to test the way it executes the finders. I was just shocked at the way weblogic6.1 handles basic finders and i'm not even talking about CMRs here. From the SQL trace, this is what i found:
for a finder findByName(),
it first selects the pimary keys from the table that match the name.
Then for every id in that resultset, it fires selects on the table to get the information. So if there are n records, it executes n+1 queries at the minimum. Please do let me know if you can verify this.