好像可以点6下,6下过后就一直卡住了。怎么回事啊? 是不是下面哪里不对啊?
applicationContext.xml 文件 <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.show_sql">false</prop>
<!-- 使用hibernate的二级缓存 -->
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<!-- 是否使用查询缓存 -->
<prop key="hibernate.cache.use_query_cache">false</prop>
<!-- 使用缓存产品的驱动类 -->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com\huaxing\ssh\modle\pojo\Employee.hbm.xml</value>
</list>
</property>
</bean>
<!-- 配置事物管理器 -->
<bean id="transctionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 配置事物的传播特性 --> <tx:advice id="txAdvice" transaction-manager="transctionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="page*" propagation="REQUIRED" />
<tx:method name="get*" propagation="REQUIRED" />
<!-- 只读事物。提高性能。不检查脏数据。 -->
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice> <!-- 哪些类的哪些方法参与事物 -->
<aop:config>
<aop:pointcut id="allManagerMethod"
expression="execution(* com.huaxing.ssh.service.*.*(..))"/>
<aop:advisor pointcut-ref="allManagerMethod"
advice-ref="txAdvice" />
</aop:config>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://localhost:3306/ssh">
</property>
<property name="username" value="root"></property>
<property name="password" value="liuhua"></property>
</bean> <bean id="employeeDao"
class="com.huaxing.ssh.dao.hibernate.EmployeeDaoHibernate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="employeeManager"
class="com.huaxing.ssh.service.impl.EmployeeManagerImpl">
<property name="employeeDao" ref="employeeDao"/>
</bean>
<bean id="pageBean"
class="com.huaxing.ssh.action.EmployeeAction" scope="prototype">
<property name="employeeManager">
<ref bean="employeeManager" />
</property>
</bean>
</beans>
applicationContext.xml 文件 <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.show_sql">false</prop>
<!-- 使用hibernate的二级缓存 -->
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<!-- 是否使用查询缓存 -->
<prop key="hibernate.cache.use_query_cache">false</prop>
<!-- 使用缓存产品的驱动类 -->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com\huaxing\ssh\modle\pojo\Employee.hbm.xml</value>
</list>
</property>
</bean>
<!-- 配置事物管理器 -->
<bean id="transctionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 配置事物的传播特性 --> <tx:advice id="txAdvice" transaction-manager="transctionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="page*" propagation="REQUIRED" />
<tx:method name="get*" propagation="REQUIRED" />
<!-- 只读事物。提高性能。不检查脏数据。 -->
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice> <!-- 哪些类的哪些方法参与事物 -->
<aop:config>
<aop:pointcut id="allManagerMethod"
expression="execution(* com.huaxing.ssh.service.*.*(..))"/>
<aop:advisor pointcut-ref="allManagerMethod"
advice-ref="txAdvice" />
</aop:config>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://localhost:3306/ssh">
</property>
<property name="username" value="root"></property>
<property name="password" value="liuhua"></property>
</bean> <bean id="employeeDao"
class="com.huaxing.ssh.dao.hibernate.EmployeeDaoHibernate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="employeeManager"
class="com.huaxing.ssh.service.impl.EmployeeManagerImpl">
<property name="employeeDao" ref="employeeDao"/>
</bean>
<bean id="pageBean"
class="com.huaxing.ssh.action.EmployeeAction" scope="prototype">
<property name="employeeManager">
<ref bean="employeeManager" />
</property>
</bean>
</beans>
解决方案 »
- Tomcat6.0.18日志过大问题?stdout输出了很多debug信息,log4j也没用?
- 你觉得这种情况我可以用Spring吗?
- 谁能救救我啊,帮我写一个连接FTP服务器的程序啊,不然偶会死掉的....
- 有朋友用jsp做过视频网站的请进来看看那
- 郁闷,子类的对象转换成父类???来者有分
- 求教用jacob进行excel转换
- 学写DTO生成器(插件)需要什么基础?
- 直接在jbuilder中运行MySessionFactory,为什么找不到/hibernate.cfg.xml
- javax.ejb.* ???
- 面试题
- 接口怎样控制硬件,怎样利用远程接口和外部进行信息交互。
- struts+spring+hibernate整合框架遇到麻烦,请知道的帮忙解决,急!在线等!!
可以,告诉我怎么怎么配置连接池,在哪里配置