Skip to content

Commit

Permalink
v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sunlightcs committed Feb 17, 2019
1 parent 35aab7e commit 9543685
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void test(){

dynamicDataSourceTestService.updateUser(id);
dynamicDataSourceTestService.updateUserBySlave1(id);
//dynamicDataSourceTestService.updateUserBySlave2(id);
dynamicDataSourceTestService.updateUserBySlave2(id);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,17 @@ public void updateUserBySlave1(Long id){
user.setUserId(id);
user.setMobile("13500000001");
sysUserDao.updateById(user);
}

@DataSource("slave2")
@Transactional
public void updateUserBySlave2(Long id){
SysUserEntity user = new SysUserEntity();
user.setUserId(id);
user.setMobile("13500000002");
sysUserDao.updateById(user);

//测试事物
//int i = 1/0;
int i = 1/0;
}

// @DataSource("slave2")
// @Transactional
// public void updateUserBySlave2(Long id){
// SysUserEntity user = new SysUserEntity();
// user.setId(id);
// user.setMobile("13500000002");
// sysUserDao.updateById(user);
//
// //测试事物
// int i = 1/0;
// }
}

0 comments on commit 9543685

Please sign in to comment.