-
1. Re: One to Many Remove Problem
dsundstrom Jun 24, 2002 4:16 PM (in response to lcranford)Yes iterator.remove(). It in the spec section 10.3.6.1.
-
2. Re: One to Many Remove Problem
lcranford Jun 24, 2002 11:55 PM (in response to lcranford)Thanks,
I'll change it.
Lance -
3. Re: One to Many Remove Problem
lcranford Jun 25, 2002 9:32 PM (in response to lcranford)Here's the code I have that's in question.
public void removeAllLineItems()
{
Collection lineItems = getLineItems(); //CMR field
for(Iterator iter = lineItems.iterator();iter.hasNext();)
{
LineItemLocal lineItem = (LineItemLocal)iter.next();
iter.remove();
}
}
Again, upon inspection of the database, the relationship records are deleted, but the actual Entity table (tb_LineItems) are not. Here's the item I found in the logs
2002-06-25 20:15:53,694 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCDeleteRelationsCommand.Order] Executing SQL: DELETE FROM TB_ORDER_LINEITEMS WHERE (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?) OR (line_item_id=? AND order_id=?)
2002-06-25 20:15:53,704 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCDeleteRelationsCommand.Order] Rows affected = 10
There seems to be a missing call to the JDBCRemoveEntityCommand class for the LineItem Entity in jboss. I was told that a call iter.remove() would do this. Is this a bug? -
4. Re: One to Many Remove Problem
jocsch Jul 20, 2002 5:30 PM (in response to lcranford)I face the same problem. Is there a solution for it?
-
5. Re: One to Many Remove Problem
dsundstrom Jul 20, 2002 11:57 PM (in response to lcranford)This looks like a bug I just fixed in cvs Branch_3_0 and HEAD.