Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nonstrict read/write vs read/write in hibernate?

Tags:

hibernate

Got thru below statement at http://docs.jboss.org/hibernate/core/3.3/reference/en/html/performance.html#performance-cache-nonstrict

If the application only occasionally needs to update data (i.e. if it is extremely unlikely that two transactions would try to update the same item simultaneously)

What I got from above statement is if developer updates a object in his code, sometime he want to update in second level cache and sometime does not. Right? If yes how he will achieve it in his code. I mean where he needs to specify in his code that this time he wants to update in cache and other time not.

like image 509
M Sach Avatar asked Feb 02 '23 11:02

M Sach


1 Answers

You got it wrong. What this means if that this strategy should be used when the entity is sometimes updated (so read-only does not apply), but that it's extremely unlikely that two concurrent transactions update the same item. For example, if you have thousands of users accessing the data, an one batch regularly update it, this option is the right one to choose: only one transaction updates the items at a time.

like image 142
JB Nizet Avatar answered Feb 07 '23 13:02

JB Nizet