Guest User

Untitled

a guest
Jun 19th, 2018
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:aop="http://www.springframework.org/schema/aop"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xmlns:util="http://www.springframework.org/schema/util"
  8. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  9. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
  10. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
  11.  
  12. <!-- Database Connection pool -->
  13. <bean id="dataSource1"
  14. class="com.zaxxer.hikari.HikariDataSource">
  15. <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  16. <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/cloudms"></property>
  17. <property name="username" value="admin"></property>
  18. <property name="password" value="admin"></property>
  19. <property name="autoCommit" value="false"></property>
  20. </bean>
  21.  
  22.  
  23. <bean id="transactionManager"
  24. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  25. <property name="dataSource" ref="dataSource1"></property>
  26. </bean>
  27.  
  28.  
  29.  
  30. <!-- Configure JdbcTemplate -->
  31. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  32. <property name="dataSource" ref="dataSource1"></property>
  33. </bean>
  34.  
  35. <bean id="flightsRepository"
  36. class="com.myapp.spring.mvc.dao.FlightsRepositoryImpl"
  37. autowire="constructor">
  38. </bean>
  39.  
  40. <!-- View Resolver -->
  41. <!-- JSP + JSTL View -->
  42. <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  43. <property name="prefix" value="/WEB-INF/jsp/"></property>
  44. <property name="suffix" value=".jsp"></property>
  45. </bean>
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52. <!-- Aspect -->
  53.  
  54.  
  55. <tx:advice id="txAdvice" transaction-manager="transactionManager">
  56. <tx:attributes>
  57. <!-- all methods starting with 'list' or 'get' are read-only -->
  58. <tx:method name="search*" propagation="REQUIRED"/>
  59.  
  60.  
  61. </tx:attributes>
  62. </tx:advice>
  63.  
  64. <aop:config>
  65. <aop:advisor pointcut-ref="serviceMethods" advice-ref="txAdvice" />
  66. <aop:aspect>
  67. <aop:pointcut id="serviceMethods"
  68. expression="execution(* com.myapp.spring.jdbc.*.*(..))" />
  69. </aop:aspect>
  70. </aop:config>
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. </beans>
Add Comment
Please, Sign In to add comment