Hi,
I have an integration
test and am trying to have the database go back to its original state at the end of the test run.
The MySQL table has the InnoDB engine.
The test is based on the Spring AbstractTransactionalJUnit4SpringContextTests class.
There is a transaction manager:
The log shows the transaction being rolled back:
2012-03-09 10:32:20,990 DEBUG [DataSourceTransactionManager] Initiating transaction rollback
2012-03-09 10:32:20,990 DEBUG [DataSourceTransactionManager] Rolling back JDBC transaction on Connection [com.mysql.jdbc.JDBC4Connection@979f67]
2012-03-09 10:32:20,991 DEBUG [DataSourceTransactionManager] Releasing JDBC Connection [com.mysql.jdbc.JDBC4Connection@979f67] after transaction
2012-03-09 10:32:20,992 DEBUG [DataSourceUtils] Returning JDBC Connection to DataSource
2012-03-09 10:32:20,993 INFO [TransactionalTestExecutionListener] Rolled back transaction after test execution for test context [[TestContext@105bd58 testClass = GInnAdresseDaoTest, testInstance = no.nki.sesam.dao.GInnAdresseDaoTest@1d1e730, testMethod = testInsertAndFindWithId@GInnAdresseDaoTest, testException = [null], mergedContextConfiguration = [MergedContextConfiguration@1a116c9 testClass = GInnAdresseDaoTest, locations = '{classpath:integration.jdbc.xml, classpath:dao.xml, classpath:integration.data-source.xml}', classes = '{}', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader']]]
Maybe it is due to the manual commit in the
JDBC dao ?
Any idea ?
Stephane