Does @Transactional automatically rollback transaction in Spring 3?

Viewed 3213

I'm running as unit test and it automatically goes back even if I don't use the@rollback in spring 3.1. My test looks like

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:application-context.xml" })
public class PersonServiceTest {

    @Test
    @Transactional
    public void savePerson() {
            Person person = createPerson();
            personService.savePerson(person);
    }
}

Is Rollback behavior is set by default?

1 Answers
Related