Quantcast
Channel: Java Programming Forum - Learn Java Programming - Hibernate
Viewing all articles
Browse latest Browse all 76

How hibernate get() and load() will work when query 2nd time

$
0
0
How hibernate get() and load() will work when query second times? Please correct me

get() -> 1) Check 1st Level Cache and 2) DB hit
load() -> 1) Check 1st Level Cache 2) Then 2nd Level Cache Then 3) DB hit
How it will work?

Suppose, I updated(or added) the record using native sql or diectly in the dabase means, how get() and load() will get the latest changes?

If that is the case, hibernate will update the cache automatically or we need to the fresh query to fill the cache( againg qury or session.refresh()?

Viewing all articles
Browse latest Browse all 76

Trending Articles