Hibernate Session provides two methods to retrieve object e.g. get() and load() both looked quite similar to each other but there are subtle difference between load and get method.
The major difference between two methods is: Continue reading
Hibernate Session provides two methods to retrieve object e.g. get() and load() both looked quite similar to each other but there are subtle difference between load and get method.
The major difference between two methods is: Continue reading
Session flush is the process of synchronizing the underlying persistent store with persistable state held in memory. Flushing the session simply gets the data in the session synchronized with the database. If a persisted object in the Session has value change, it becomes dirty, and Session flush will update the database in the running transaction, but it may not commit those changes. Continue reading
Hibernate query cache does not cache the state of actual entities in the result set, and it caches only identifier values and results of value type. Query cache integrates closely with the second-level cache, and is useful for queries that are executed frequently with the same parameters. Continue reading
To enable second level cache, here we will use EHCache. Continue reading
A couple of examples are given to shows Hibernate first level cache scenario. Continue reading
Caching is an import technique in Hibernate. When you use Hibernate in the application and enable Hibernate SQL trace, you might notice lots of SQL queries executed to grab data back from the database. A large number of such kinds of queries will finally slow down your application. Hibernate caching is a good choice to minimize the database hits and improve the performance of the application. Continue reading
The main function of a Hibernate session is to open a database connection, and offer read and update operations for instances. Each instance object associated with the session will keep alive until the session is closed or the object is deleted. Continue reading
Normally, opening a connection to a database consumes more time than executing an SQL statement. Connection pools can help to reuse some connections without creating the connections frequently. In DAO layer, it will help to improve your system performance. Continue reading