Does hibernate provide smart caching?

Our DBA has just returned with a long query to our SQL server database. He thought that we should consider this request and see if we can optimize.

The problem is that the request does not come from our application code. It loads several records from one table with its primary key, nine more precisely, and we NEVER have any queries to this table from the primary key from our application. It is also definitely a sleeping request by the name that controls this sleeping mode, and loading all properties.

So, I am wondering if hibernate does some predictive caching, for example by pulling on records that, in my opinion, I will want later. Any input on this?

Thank.

+5
source share
2 answers

This is probably a query that is being executed due to batch fetching :

Using batch fetching, Hibernate can load multiple uninitialized proxies if accessing the same proxy. Batch sampling is an optimization lazy choice strategy.

/ . : 25 Cat, , , . Person -, lazy = "true". getOwner() , Hibernate , default, 25 SELECT . , :

<class name="Person" batch-size="10">...</class>

Hibernate : 10, 10, 5.

+3

, / .

, Hibernate - , .

, , , realtionships, , .

0

All Articles