我的项目采用Spring OpenSessionInView的事务控制方式,但是没有起作用,高手帮忙看看,谢谢啦~~
1条回答 默认 最新
- 一夕JZ 2013-07-09 09:39关注
web.xml:
hibernateFilter
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
singleSession
true
hibernateFilter
.Spring配置:
<bean id="propertyConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>classpath:config/jdbc.properties</value> </property> </bean> <bean id="dataSourceOracle" class="com.jolbox.bonecp.BoneCPDataSource" destroy-method="close"> <property name="driverClass" value="${jdbc.driver}" /> <property name="jdbcUrl" value="${jdbc.url}" /> <property name="username" value="${jdbc.user}" /> <property name="password" value="${jdbc.password}" /> <property name="idleConnectionTestPeriod" value="60" /> <property name="idleMaxAge" value="240" /> <property name="maxConnectionsPerPartition" value="6" /> <property name="minConnectionsPerPartition" value="2" /> <property name="partitionCount" value="1" /> <property name="acquireIncrement" value="5" /> <property name="statementsCacheSize" value="100" /> <property name="releaseHelperThreads" value="3" /> </bean>
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
value="classpath:hibernate.cfg.xml"><bean id="parentDao" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <description>All Dao bean's parent bean, define the common sessionFactory property of Dao implements classes </description> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="transactionProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager" ref="parentDao"></property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
- ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
- ¥50 opencv4nodejs 如何安装
- ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
- ¥15 nginx反向代理获取ip,java获取真实ip
- ¥15 eda:门禁系统设计
- ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
- ¥15 376.1电表主站通信协议下发指令全被否认问题
- ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
- ¥15 复杂网络,变滞后传递熵,FDA