[hibernate-dev] Configuration to support batching (or sorting) of DELETE statements efficiently
Vlad Mihalcea
mihalcea.vlad at gmail.com
Wed Jan 27 01:43:08 EST 2016
This must be done like insert but in reverse order. With inserts, we need
to add parents first and children after, because of the foreign key
constraints.
For delete, we need to group children first and delete them prior to
deleting parents.
Is there something that prevents us from implementing this feature?
Vlad
On Wed, Jan 27, 2016 at 7:01 AM, Madhusudana Reddy Sunnapu <
smreddy2004 at gmail.com> wrote:
> Hi,
>
> Hibernate provides simple configuration properties to enable batch inserts
> and updates using "hibernate.order_inserts" and "hibernate.order_updates"
> respectively. These setting allow hibernate to sort the insert and update
> statements and process them in batches efficiently.
>
> But we don't have such a configuration to sort or batch delete statements
> efficiently. Especially with CascadeType.DELETE we can see that delete
> statements are not batched effectively and could result in extra network
> calls to the database for deletion.(Refer:
>
> http://vladmihalcea.com/2015/03/26/how-to-batch-delete-statements-with-hibernate/
> )
>
> So I am thinking wouldn't it be a good feature to have hibernate support
> similar configuration, say "hibernate.order_deletes", to enable batch
> deletes similar to updates and inserts.
>
> Cheers,
> Madhu.
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
More information about the hibernate-dev
mailing list