Skip to content

Commit 6e817bc

Browse files
committed
Just a comment with a TODO with MyBatis TX handling
1 parent 6b55042 commit 6e817bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/java/org/mybatis/spring/submitted/xa/UserServiceTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ public void testCommitWithExistingTx() throws Exception {
6060
Assert.assertTrue(userService.checkUserExists(user.getId()));
6161
}
6262

63+
// TODO when the outer JTA tx is rolledback,
64+
// SqlSession should be rolledback but it is committed
65+
// because Spring calls beforeCommmit from its TX interceptor
66+
// then, the JTA TX may be rolledback.
6367
@Test
6468
public void testRollbackWithExistingTx() throws Exception {
6569
userTransaction.begin();
66-
User user = new User(4, "Pocoyo");
70+
User user = new User(5, "Pocoyo");
6771
userService.saveWithNoFailure(user);
6872
userTransaction.rollback();
6973
Assert.assertFalse(userService.checkUserExists(user.getId()));

0 commit comments

Comments
 (0)