I am having a problem with an integration test which tests several services. I had to disable transactional to get the test working without any transactional related runtime errors. The integration test works fine when running it on its own but when running with other tests, which have transactional enabled, it creates this runtime error:
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 have concluded that the reason the runtime occurs is because of the other integration tests which use transactions, as I tested this by successfully running all tests which have transactional disabled; and was unsuccessful when running the test with a single integration test with transactional enabled.
How can I mix transactional and non-transactional integration tests in Grails?
Platform Details:
Grails-2.3.6 Windows 7 64 bit. JDK v6.
static transactional = false
and runs fine in isolation but fails when I run the entire suite. – Klara