I am having a problem with an integration test that checks multiple services. I had to disable the transaction in order to get the test to work without any transactional runtime errors. The integration test works fine when you run it yourself, but when working with other tests that include a transaction, this runtime error is created:
Running 48 integration tests... 43 of 48 Failure: Tests the happy case flow of MyService.(MyServiceSpec) org.springframework.transaction.HeuristicCompletionException: Heuristic completion: outcome state is rolled back; nested exception is org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has bee n marked as rollback-only Caused by: org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only ... 4 more Completed 43 integration tests, 1 failed in 0m 32s
I came to the conclusion that the reason the runtime occurs is related to other integration tests that use transactions, since I tested this by successfully completing all the tests that were disabled by the transaction; and was unsuccessful when starting a test using a single integration test with a transaction included.
How can I mix transactional and non-transactional integration tests in Grails?
Platform Details:
Grails-2.3.6 Windows 7 64 bit. JDK v6.
source share