Himanshu shriv

Himanshu shriv

42 Articles Published

Articles by Himanshu shriv

Page 5 of 5

Difference Between get() and load() in Hibernate

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 27K+ Views

In hibernate, get() and load() are two methods which is used to fetch data for the given identifier. They both belong to Hibernate session class. Get() method return null, If no row is available in the session cache or the database for the given identifier whereas load() method throws object not found exception. Sr. No.KeyGet()Load()1Basic It  is used to fetch data from the database for the given identifier  It  is also used to fetch data from the database for the given identifier 2Null Object It object not found for the given identifier then it will return null object It will throw object not found exception 3Lazy ...

Read More

Difference Between First level cache and Second level cache in Hibernate

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 11K+ Views

Hibernate support two type of cache one is first level cache and other is second level cache. First level cache is a session level cache and it is always associated with session level object. This type of cache is used for minimizing Db interaction by caching the state of the object. That is instead of updating after every modification done in the transaction, it updates the transaction only at the end of the transaction.Second level cache is session factory level cache and it is available across all sessions.While running the transactions, in between it loads the objects at the Session Factory level, ...

Read More
Showing 41–42 of 42 articles
« Prev 1 2 3 4 5 Next »
Advertisements