<p>According to what I have found so far, I can use the following code:</p>

<pre>
    LocalSessionFactoryBean sessionFactory = (LocalSessionFactoryBean)super.getApplicationContext().getBean("&sessionFactory");
    System.out.println(sessionFactory.getConfiguration().buildSettings().getJdbcBatchSize());
</pre>

<p>but then I get a Hibernate Exception:</p>

<blockquote>
  <p>org.hibernate.HibernateException: No local DataSource found for
  configuration - dataSource property must be set on
  LocalSessionFactoryBean</p>
</blockquote>

<p>Can somebody shed some light?</p>

Try the following (I can't test it since I don't use Spring):
```
```
System.out.println(sessionFactory.getConfiguration().getProperty("hibernate.jdbc.batch_size"))
```
```