openjpa-users mailing list archives

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

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
do...

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!

Christian

On 8/15/07, Christiaan <christiaan_db@hotmail.com> 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: http://www.nabble.com/Performance%3A-single-vs-multiple-transactions-tf4272115.html#a12159177
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>

Mime
View raw message