Announcement Announcement Module No announcement yet. Testing
and Transactional Page Title Module Move Remove Collapse
Conversation Detail Module   • Filter   • Time   • Show Clear
All new posts    • Testing and Transactional      I'm new to
Spring and having a difficult time figuring out @Transactional.
My basic setup:      JPA, Java Configuration, CTW,
AnnotationTransactionAspect.aspectOf(), spring-configured,
Hibernate, component scan on everything for now.      Test runs
with SpringJUnit4ClassRunner. Each Test class is annotated with:
@DirtiesContext(classMode =
DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD )     I have a
parent entity and a child entity. There is a ONETOMANY
relationship between them. Though I don't think this is
relevant.      My test methods are NOT annotated with
@Transactional. I want to make sure that my service layer is
using flush, et al correctly so I need committed transactions
between operations within the test method.      My
@Transactional usage is in my service layer.