title: Hibernate sessionFactory rebuilt for each unit test (using spring framework)
body: <p>I'm using Spring's AbstractTransactionalDataSourceSpringContextTests for my persistence unit tests and my problem is my tests are too slow: 1 method=5s, and each additional method is at least another second. I've over 300 db tables so a slow startup is perhaps understandable. However I've gone through the logs and one of the surprising things is that the Hibernate sessionFactory is rebuilt for each test method. And it's half the runtime cost of each additional method.</p>
  
  <p>Shouldn't I be able to reuse the original sessionFactory?</p>
  
  <p>I've delved a little into the source code and I haven't seen an obvious way to force the sessionFactory to be reused.</p>
  
  <p>Any ideas?</p>
  
  <p>And any other ideas for speeding up persistence unit tests?</p>
  
  <p>(Spring 2.5 and Hibernate 3.2ish, hsqldb)</p>