db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oliver.m...@ppi.de
Subject performance: surpress m:n collection deletion on insert
Date Thu, 21 Aug 2003 14:15:43 GMT

I have found and fixed a performance issue.

Suppose you have a pc class A with a collection field
with itemClass B, and supose that collection is mapped to an
indirection table A_B.

If you insert a fresh A instance with a null collection,
then this results in one INSERT statement for the A 
table and one DELETE statement for the indirection table A_B.

The latter should usually be superflous, since there should
not be any entries in the indirection table.  If there are
ones, this is probably an error.

In my proposed fix, I surpress the deleteMtoNImplementor() call
inside storeCollections().  

If you consider this change of behaviour risky, then I would
like to propose to add a configuartion parameter that allows
to force the old behaviour.

In my model, the proposed fix results in a significant 
performance improvement because the class A has severall
collection fields which are mostly null.

If you have another idea how to surpess the superflous calls,
I would like to know.

What do you think?

  Dr. Oliver Matz
  ppi Media GmbH
  Deliusstra├če 10
  D-24114 Kiel
  phone		+49 (0) 43 1-53 53-422
  fax     	+49 (0) 43 1-53 53-2 22
  email	mailto:oliver.matz@ppi.de
  web	www.ppi.de

View raw message