-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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: 7
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: 1630
Location: Romania
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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.