You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Chris Lewington <cl...@ebi.ac.uk> on 2004/03/24 18:23:11 UTC

Collection Size Limit for Updates?

Hi all,

Does anyone know roughly what the biggest Collection size is that an
object can contain when doing an update? Around 1000 seems OK, but
20,000 throws an OutOfMemoryError. Since OJB does 'delete + insert' for
update, for an m:n relation with 20,000 objects you get 20,000 deletes,
then 20,000+ array copies then 20,000 inserts if you don't touch
anything in the Collection - thus changing eg only a String in the top
object results in this behaviour when all you really wanted was to
change a single column value in one table.

This is not an artifical situation - we have this in our project. We
cannot update a String in our top level object simply because it is
linked to 20,000 others, even though we are not touching those other
objects (or the relation between the two).

Cheers,

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Collection Size Limit for Updates?

Posted by Armin Waibel <ar...@apache.org>.
Hi Chris,

Chris Lewington wrote:

> Hi all,
> 
> Does anyone know roughly what the biggest Collection size is that an
> object can contain when doing an update? Around 1000 seems OK, but
> 20,000 throws an OutOfMemoryError. Since OJB does 'delete + insert' for
> update, for an m:n relation with 20,000 objects you get 20,000 deletes,
> then 20,000+ array copies then 20,000 inserts if you don't touch
> anything in the Collection - thus changing eg only a String in the top
> object results in this behaviour when all you really wanted was to
> change a single column value in one table.
> 

This is a result of the auto-update setting handling. There are two big 
threads on the dev-list discuss this behaviour.

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-dev@db.apache.org&msgNo=6531
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-dev@db.apache.org&msgNo=6538

Currently I refactoring the auto-xxx handling in OJB. We will introduce 
additional values for auto-update/delete. For more detailed info, please 
read the " auto-XXX setting (PART II)" thread on dev-list.

regards,
Armin

> This is not an artifical situation - we have this in our project. We
> cannot update a String in our top level object simply because it is
> linked to 20,000 others, even though we are not touching those other
> objects (or the relation between the two).
> 
> Cheers,
> 
> Chris
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org