Why won't the transaction start in my junit test cases?
问题 I have a Spring 3.1 MVC + Hibernate 3.6 project with its junit4 test suit. My problem is that there is no transaction starting in my test cases, even thought I added a @Transactional . My test case calls a controller and a dao. In the controller, a transaction is started anyway, so it does not complain. In the dao, I added a @Transactional(propagation = Propagation.MANDATORY) to be sure it will take the test's transaction. And currently it raises an IllegalTransactionStateException , which I