How do I get the value of the jdbc.batch_size property at runtime for a Web application using Spring MVC and Hibernate?
hibernate, java, spring
Solution
Try the following (I can't test it since I don't use Spring):
System.out.println(sessionFactory.getConfiguration().getProperty("hibernate.jdbc.batch_size"))
Problem
According to what I have found so far, I can use the following code: ``` LocalSessionFactoryBean sessionFactory = (LocalSessionFactoryBean)super.getApplicationContext().getBean("&sessionFactory"); System.out.println(sessionFactory.getConfiguration().buildSettings().getJdbcBatchSize()); ``` but then I get a Hibernate Exception: org.hibernate.HibernateException: No local DataSource found for configuration - dataSource property must be set on LocalSessionFactoryBean Can somebody shed some light?