Hibernate Persistence Class
– This is the Class that represents a Database table. What is required of this Class are the corresponding fields, its Setters and Getters, and a Constructor. Other properties of this table are defined in the *.hbm.xml file.
– The Session is the Object used for the database transactions. This is where we can set all our SQL ( or in this case HQL / Hibernate Query Language ) and the Persistence class for Database Transaction. It is advised only create and open a session if needed, and close it after the transaction. The Session Factory is Thread Safe, but Sessions are not.
Hibernate Batch Processing
– Hibernate allows batch processing. To do this, the session must be flush() and clear() in a certain point of the iteration, before doing transaction commit.
also another tip is to set these properties. It sort the inserts and updates, for better performance.
Below are some good tips on how to do a Batch process:
– Hibernate operates with a default first level cache, and a option to activate the secondary cache, and even additional caches from a 3rd party is permitted.
– Interceptors are functions in hibernate that can do process during the time a session is doing transaction in the cache and in the database. Interceptors can cut in inside the steps of this process.