Given the following:
- An integration test is started using
@Transactional(Propagation.REQUIRED)
at class level. - Some reference data is inserted with
Propagation.NOT_SUPPORTED
specified at method level. - A service method marked as
@Transactional(Propagation.REQUIRED)
attempts to look up some reference data inserted in step 2.
The service method can't see the reference data!
My understanding was that if data is inserted outside the transaction, it would be instantly accessible to another method whether it is inside or outside the transaction. Could anyone explain?
Not a complete answer but I think these woes are partially caused by running integration tests inside an overarching transaction - this article explains why this is a bad idea. Am going to attempt to rewrite all the data population to be non-transactional and cleared up manually at the end of each test.