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.
Shouldn't I be able to reuse the original sessionFactory?
I've delved a little into the source code and I haven't seen an obvious way to force the sessionFactory to be reused.
Any ideas?
And any other ideas for speeding up persistence unit tests?
(Spring 2.5 and Hibernate 3.2ish, hsqldb)