Difference between save and saveOrUpdate in Hibernate

What is difference between save and saveOrUpdate in Hibernate are most important in any Hibernate interview. Hibernate Session is the interface between java application and hibernate framework. It provides some methods to move an object from new or transient state to persistent state. For example, save(), saveOrUpdate() and persist() methods are used to store an … Read more

Hibernate SessionFactory Example

The Hibernate SessionFactory Example shows you how to use SessionFactory in Hibernate. Hibernate SessionFactory is used to create Sessions. Each application is having usually only one SessionFactory. Hibernate SessionFactory is thread safe, so that many threads can access it concurrently and requests the sessions. Hibernate SessionFactory provides three methods through which we can get Session … Read more

Hibernate Second Level Cache Example – Ehcache configuration example

Welcome to the Hibernate Second Level Cache Example tutorial. Now, we will taking a ehcache configuration example to clarify about Hibernate Second Level Cache. EHCache is the most popular Hibernate Second Level Cache provider. One important thing, we should know different strategies for caching an object: Read Only: It should be used for persistent objects … Read more

Hibernate First Level Cache Example

This Hibernate First Level Cache Example tutorial will help you understand about First Level Cache mechanism of Hibernate. Notice thant if you use Hibernate Cache correctly it will be very useful in increasing application performance. The idea of Hibernate cache is to reduce number of database queries, hence improving performance of the application. Hibernate supports … Read more

Please share it if you found this useful
Hide Buttons