ozlevanon the answer to both your questions is yes. In the java class HibernateUtil, the spring annotation Autowired ensures the sessionFactory is set as defined in applicationContext.xml. No java code calls setMySessionFactory but it is definitely being called as I verified with a breakpoint. It is therefore definitely being called via spring according to the settings in applicationContext.xml.
@Autowired
public void setMySessionFactory(Sessio
sessionFactory = value;
}
Main Topics
Browse All Topics





by: ozlevanonPosted on 2009-07-20 at 07:41:50ID: 24895491
Are you using your session factory defined in applicationContext.xml?
It seems to me you need to use it in your code. Are you calling setMySessionFactory with the value of bean "mySessionFactory" you get from the ApplicationContext (or making sure you use the bean in any other way)?