openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Defoy" <>
Subject Re: Performance: single vs multiple transactions
Date Wed, 15 Aug 2007 12:38:38 GMT

To my understanding, this is a typical database behavior.  If you
perform massive operations within a single transaction, the db must
account for everything in its log and it must lock all appropriate
rows.  In case of a rollback, your db will also have a lot of work to

It is usually possible to find some arbitrary number of operations
that can be bundle together without slowing the process too much.
This value depends on what you are deleting and the operations that
OpenJPA does for every delete...

I hope this helps!


On 8/15/07, Christiaan <> wrote:
> Hi,
> I am working with a large tree structure domain model and when performing a
> delete the following (summarized) code gets executed (Using Kodo 4.1.4) :
> myDelete(PersistenceObject o) {
>  updateReferences(object);
>  pm.flush();
>  pm.deleteObject(object);
>  pm.flush()
> }
> Now when I delete a large collection of objects (> 15000) I noticed the
> following performance behaviour. If I call delete on every object within one
> transaction, the performance of myDelete() quickly builds up. After a couple
> of deletes it is 120 ms per call, after a few hundred calls it is already
> 500 ms.
> However, if I put each call to myDelete() in a single transaction it stays
> consistently 40 ms.
> kind regards,
> Christiaan
> --
> View this message in context:
> Sent from the OpenJPA Users mailing list archive at

View raw message