Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Why @DynamicInsert, @DynamicUpdate are disabled by default
PostPosted: Mon Mar 27, 2017 1:17 am 
Newbie

Joined: Mon Mar 27, 2017 1:14 am
Posts: 2
I have a question regarding following attributes.

Why Hibernate set the Dynamic Insert=false and Update=false by default?


Top
 Profile  
 
 Post subject: Re: Dynamic Insert And Dynamic Update
PostPosted: Mon Mar 27, 2017 2:59 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1103
The dynamic inserts and updates are very useful for two reasons:

- reducing OptimisticLockException false positives on non-overlapping write-concern property sets
- avoiding some processing overhead related to updating indexes

However, the dynamic insert/update have drawbacks as well:

- you cannot reuse server-side and client-side prepared statements
- it reduces the likelihood of benefiting from batch updates since the statement might change from one entity to the other.

So, there is no good way or bad way. It just depends on your data access patterns to figure out which of these two makes sense for a given entity.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.