Posts

Image
Ques)Difference between AnnotationSessionFactoryBean and LocalSessionFactoryBean? Ans:- AnnotationSessionFactoryBean which is not available in Hibernate 4. As a part of migration process of your Hibernate 3 application to Hibernate 4 you have to make necessary changes in your configuration files.   If you use the following code in your Hibernate 4 application it will give you the error. Code used in Spring 3: <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"/> Application may give the following error: nested exception is java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider; So, you have to use the org.springframework.orm.hibernate4.LocalSessionFactoryBean instead of AnnotationSessionFactoryBean. So this change is required as a process of migration to Hibernate 4. In the Hibernate 4 the  CacheProvider -related interfaces and classes has been removed. Now the RegionFactor