JUnit tests always rollback the transactions

后端 未结 7 1283
死守一世寂寞
死守一世寂寞 2020-12-05 02:54

I\'m running a simple JUnit test agains an application DAO. The problem is that I always get:

javax.persistence.RollbackException: Transaction marked as roll         


        
7条回答
  •  时光说笑
    2020-12-05 03:12

    Just add annotation Rollback and set the flag to false.

       @Test
       @Rollback(false)
    

提交回复
热议问题