(158) - 对配置,代码必要的地方添加注释,方便理解

0.6
LSZ 2016-08-20 15:18:33 +08:00
parent ded5755ca5
commit 95b7296dbc
3 changed files with 16 additions and 0 deletions

View File

@ -9,6 +9,7 @@
<!--
Mandatory Default Cache configuration. These settings will be applied to caches
created programmtically using CacheManager.add(String cacheName)
EhCache 配置
-->
<defaultCache
maxElementsInMemory="10000"

View File

@ -1,3 +1,5 @@
#项目的配置文件
#
#JDBC configuration information
jdbc.driverClassName=com.mysql.jdbc.Driver
############

View File

@ -8,6 +8,9 @@
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">
<!--
配置项目的 Spring Context(上下文) 环境
-->
<!--annotation configuration -->
<context:annotation-config/>
<context:component-scan base-package="com.monkeyk.sos"/>
@ -21,6 +24,9 @@
</property>
</bean>
<!--
使用 DBCP 数据源配置
-->
<!--dataSource-->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
@ -36,10 +42,17 @@
<property name="maxIdle" value="5"/>
</bean>
<!--
事务配置, 使用DataSource事务
-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!--
启用事务的注解支持
-->
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">