Spring/JTA/JPA DAO integration test doesn't rollback?

前端 未结 2 807
逝去的感伤
逝去的感伤 2021-01-19 06:28

My DAO integration tests are failing because entities created during the tests are still in the database at the start of the next test. The exact same behavior is seen from

2条回答
  •  不要未来只要你来
    2021-01-19 07:20

    I think you will need to go through the logs in details. It could be that the rollbacks you are seeing are working, except that something else has executed a commit first. I also cannot see anything in your code which indicates automated rollback. And that it should occur at the end of each test. If you are depending on a timeout based rollback it could be that the second test is running before the timeout occurs, therefore it sees the data before it is rolled back.

    Many options here there is :-)

提交回复
热议问题