'rollback junit'에 해당되는 글 1건

  1. 2012.04.27 [test] springmvc junit transaction handling
2012. 4. 27. 11:00 IT

WHY?

ROLLBACK 하려고 하는데 다른 곳에서 참조한 문서들로는 잘 안먹더라...


example


@TransactionConfiguration(transactionManager="txManager", defaultRollback=true) // transactionManager id나 name을 명시..

public class YourRollbackTest {

@Transactional

@Test public void testRollbackTest() throws Exception{

                // do test 
         }

}



@Test 어노테이션이 붙은 곳에서 @Transactional을 사용하면 항상 rollback 처리해주네요.. 

posted by smplnote