解决方案 »
- 求助!控制台打印出信息了,但是页面没有显示,为什么?
- 如何在页面判断汉字中包含有繁体字和生僻字
- 好久没提问了,问个可能有点难度的问题供高人玩玩-java如何判断QQ号码的有效性呢?
- SSH中的数据库连接问题
- 用spring的getJdbcTemplate()执行更新操作为什么会抛空指针异常 啊?
- myeclise+hibernate 自动更新配置文件的问题
- hibernate 的left join fetch可以取出lazy对象,如果lazy的是Set,还想对Set里面对象进行继续Fetch他的成员怎么办呢?
- 急!通过HttpSessionListener统计在线人数出现负值!
- tomcat配置的若干问题的求教!!!请高手赐教!!!小弟不胜感激
- Norwaywoods请来,刚才分太少,追加给分 谢谢
- 妹子求助一道编程题,想了半天完全没思路
- axis2 客户端调用webservice出错。
<aop:config>
<aop:pointcut id="ServiceMethods"
expression="execution(* com.hrmsys.service.impl..*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="ServiceMethods" />
</aop:config>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
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-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
"> <!-- 导入数据配置 -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:jdbc.properties</value>
</property>
</bean>
<!-- ****************************************数据源*************************************************************** -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<!-- 指定连接数据库的驱动 -->
<property name="driverClass" value="${jdbc.driverClass}" />
<!-- 指定连接数据库的URL -->
<!-- &zeroDateTimeBehavior=convertToNull是为了避免因数据库中为date类型的数据为0000-00-00,
若为此值hibernate会报错‘Cannot convert value '0000-00-00 00:00:00' from column 1
to TIMESTAMP’ -->
<property name="jdbcUrl" value="${jdbc.jdbcUrl}" />
<!-- 指定连接数据库的用户名 -->
<property name="user" value="${jdbc.username}" />
<!-- 指定连接数据库的密码 -->
<property name="password" value="${jdbc.password}" />
<!-- 指定连接数据库连接池的最大连接数 -->
<property name="maxPoolSize" value="${jdbc.maxPoolSize}" />
<!-- 指定连接数据库连接池的最小连接数 -->
<property name="minPoolSize" value="${jdbc.minPoolSize}" />
<!-- 指定连接数据库连接池的初始化连接数 -->
<property name="initialPoolSize" value="${jdbc.initialPoolSize}" />
<!-- 指定连接数据库连接池的连接的最大空闲时间 -->
<property name="maxIdleTime" value="${jdbc.maxIdleTime}" />
<!-- 指定隔多少秒检查所有连接池中的空闲连接,默认为0表示不检查 -->
<property name="idleConnectionTestPeriod" value="18000" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<!-- <prop key="hibernate.hbm2ddl.auto">update</prop> -->
<prop key="hibernate.jdbc.use_scrollable_resultset">false</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.current_session_context_class">org.springframework.orm.hibernate4.SpringSessionContext
</prop>
</props>
</property>
<property name="packagesToScan" value="com.hrmsys.entity" />
</bean> <!-- 配置事务 begin -->
<bean id="txManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean> <tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="update*" propagation="REQUIRED" read-only="false" />
<tx:method name="delete*" propagation="REQUIRED" read-only="false" />
<tx:method name="save*" propagation="REQUIRED" read-only="false" />
<tx:method name="find*" propagation="REQUIRED" read-only="false" />
<tx:method name="get*" propagation="REQUIRED" read-only="false" />
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice> <aop:config>
<aop:pointcut id="ServiceMethods"
expression="execution(* com.hrmsys.service.impl..*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="ServiceMethods" />
</aop:config>
<!-- 配置事务 end --> <!-- 引入其它文件 -->
<import resource="applicationContext-dao.xml" />
<import resource="applicationContext-service.xml" />
<import resource="applicationContext-action.xml" />
</beans>
不会影响,不过劝你还是别用spring了,事务管理问题严重,这么多版本了,还是没有解决,我吃过亏的,还是用标准的东西吧。
不会影响,不过劝你还是别用spring了,事务管理问题严重,这么多版本了,还是没有解决,我吃过亏的,还是用标准的东西吧。
不用spring用什么?
不会影响,不过劝你还是别用spring了,事务管理问题严重,这么多版本了,还是没有解决,我吃过亏的,还是用标准的东西吧。
不用spring用什么?
CDI,EJB,至于控制层,struts2倒是能用。