Guest User

Untitled

a guest
Jul 20th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. <!-- txAdvice -->
  2. <tx:annotation-driven mode="aspectj" />
  3.  
  4. <tx:advice id="txAdvice">
  5. <tx:attributes>
  6. <tx:method name="find*" />
  7. <tx:method name="insert*" />
  8. </tx:attributes>
  9. </tx:advice>
  10.  
  11. <!-- Aspect -->
  12. <aop:aspectj-autoproxy proxy-target-class="true" />
  13.  
  14. <aop:config>
  15. <aop:pointcut id="pointcut" expression="execution(* com.quapenus.*.service.*Impl.*(..))" />
  16. <aop:advisor pointcut-ref="pointcut" advice-ref="txAdvice" />
  17. </aop:config>
  18.  
  19. @Service
  20. public class LoginServiceImpl implements LoginService {
  21. Logger logger = LoggerFactory.getLogger(LoginServiceImpl.class);
  22.  
  23. @Autowired
  24. private LoginDao loginDao;
  25.  
  26. @Override
  27. public Member findMemberInfo(String username) throws UsernameNotFoundException {
  28. Member member = loginDao.findMemberInfo(username);
  29.  
  30. if(member == null){
  31. throw new UsernameNotFoundException("아이디가 존재하지 않습니다.");
  32. }
  33.  
  34. return member;
  35. }
  36.  
  37. @Override
  38. public List<GrantedAuthority> findRoles(String username) throws NotFoundException {
  39. List<GrantedAuthority> roles = loginDao.findRoles(username);
  40.  
  41. if(roles.size() == 0){
  42. throw new NotFoundException("해당 역할이 없습니다.");
  43. }
  44.  
  45. return roles;
  46. }
  47.  
  48. @Override
  49. public void insertMember(Member member) throws RollbackException {
  50. int result = loginDao.insertMember(member);
  51.  
  52. if(result == 1){
  53. throw new RollbackException("Test Tx");
  54. }
  55. }
  56. }
  57.  
  58. 17:13:01.070 [http-nio-8080-exec-6] DEBUG
  59.  
  60. org.springframework.beans.BeanUtils - No property editor [java.lang.StringEditor] found for type java.lang.String according to 'Editor' suffix convention
  61. 17:13:01.079 [http-nio-8080-exec-6] DEBUG org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession
  62. 17:13:01.086 [http-nio-8080-exec-6] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@77b976a0] was not registered for synchronization because synchronization is not active
  63. 17:13:01.100 [http-nio-8080-exec-6] DEBUG o.s.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
  64. 17:13:01.246 [http-nio-8080-exec-6] DEBUG o.m.s.t.SpringManagedTransaction - JDBC Connection [jdbc:mysql://127.0.0.1:3306/quapenus, UserName=root, MariaDB connector/J] will not be managed by Spring
  65. 17:13:01.264 [http-nio-8080-exec-6] DEBUG c.q.c.sql.LoginMapper.insertMember - ==> Preparing: insert into QPNS_MEMBER( USERNAME, PASSWORD, MEMBER_NM, MEMBER_AGE, MEMBER_GENDER, MEMBER_CMMT, MEMBER_TEL, REGIST_DT ) values ( ?, ?, ?, ?, ?, ?, ?, ? )
  66. 17:13:01.335 [http-nio-8080-exec-6] DEBUG c.q.c.sql.LoginMapper.insertMember - ==> Parameters: weinogaczxvz(String), (String), (String), (String), M(String), (String), null, null
  67. 17:13:01.341 [http-nio-8080-exec-6] DEBUG c.q.c.sql.LoginMapper.insertMember - <== Updates: 1
  68. 17:13:01.347 [http-nio-8080-exec-6] DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@77b976a0]
  69. 17:13:01.347 [http-nio-8080-exec-6] DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
  70. 17:13:01.427 [http-nio-8080-exec-6] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
  71. 17:13:01.428 [http-nio-8080-exec-6] DEBUG o.s.w.s.m.m.a.RequestResponseBodyMethodProcessor - Written [{result=FAIL, errorMsg=Test Tx}] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@329816a3]
  72. 17:13:01.429 [http-nio-8080-exec-6] DEBUG o.s.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'dispatcher': assuming HandlerAdapter completed request handling
  73. 17:13:01.429 [http-nio-8080-exec-6] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request
  74. 17:13:01.429 [http-nio-8080-exec-6] DEBUG o.s.s.w.a.ExceptionTranslationFilter - Chain processed normally
  75. 17:13:01.429 [http-nio-8080-exec-6] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
  76.  
  77. 17:58:07.052 [http-nio-8080-exec-9] INFO com.quapenus.core.util.AspectTest - com.quapenus.login.service.LoginServiceImpl: ASPECT TEST
  78. 17:58:07.052 [http-nio-8080-exec-9] DEBUG org.mybatis.spring.SqlSessionUtils - Creating a new SqlSession
  79. 17:58:07.052 [http-nio-8080-exec-9] DEBUG org.mybatis.spring.SqlSessionUtils - Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4db7d396]
  80. 17:58:07.052 [http-nio-8080-exec-9] DEBUG o.m.s.t.SpringManagedTransaction - JDBC Connection [jdbc:mysql://127.0.0.1:3306/quapenus, UserName=root, MariaDB connector/J] will be managed by Spring
  81. 17:58:07.052 [http-nio-8080-exec-9] DEBUG c.q.c.sql.LoginMapper.findMemberInfo - ==> Preparing: SELECT USERNAME, PASSWORD, MEMBER_NM, MEMBER_TEL, MEMBER_GENDER, MEMBER_AGE, MEMBER_CMMT, REGIST_DT, UPDT_DT, DELETE_AT, ENABLED FROM QPNS_MEMBER WHERE USERNAME = ?
  82. 17:58:07.053 [http-nio-8080-exec-9] DEBUG c.q.c.sql.LoginMapper.findMemberInfo - ==> Parameters: asdnfasdfnsaf(String)
  83. 17:58:07.054 [http-nio-8080-exec-9] DEBUG c.q.c.sql.LoginMapper.findMemberInfo - <== Total: 0
  84. 17:58:07.054 [http-nio-8080-exec-9] DEBUG org.mybatis.spring.SqlSessionUtils - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4db7d396]
  85. 17:58:07.054 [http-nio-8080-exec-9] DEBUG org.mybatis.spring.SqlSessionUtils - Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4db7d396]
  86. 17:58:07.054 [http-nio-8080-exec-9] DEBUG org.mybatis.spring.SqlSessionUtils - Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@4db7d396]
  87. 17:58:07.054 [http-nio-8080-exec-9] DEBUG o.s.j.d.DataSourceTransactionManager - Initiating transaction rollback
  88. 17:58:07.054 [http-nio-8080-exec-9] DEBUG o.s.j.d.DataSourceTransactionManager - Rolling back JDBC transaction on Connection [jdbc:mysql://127.0.0.1:3306/quapenus, UserName=root, MariaDB connector/J]
  89. 17:58:07.055 [http-nio-8080-exec-9] DEBUG o.s.j.d.DataSourceTransactionManager - Releasing JDBC Connection [jdbc:mysql://127.0.0.1:3306/quapenus, UserName=root, MariaDB connector/J] after transaction
  90. 17:58:07.055 [http-nio-8080-exec-9] DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
Add Comment
Please, Sign In to add comment