Hibernate更新数据库的诡异问题
请问下我现在生产上有个诡异问题,更新数据库表记录时,大约2周-3周会出现一次数据更新不成功的情况,底层无任何异常抛出。
数据库:Oracle
Hibernate:3.2.5 GA
Spring: 2.5
<bean id="dataSource" class="com.ccb.cost.common.datasource.ProxDataSource"> <property name="driver" value="oracle.jdbc.driver.OracleDriver" /> <property name="driverUrl" value="jdbc:oracle:thin:@10.181.76.4:1521:esb" /> <property name="user" value="cost" /> <property name="password" value="cost" /> <property name="maximumConnectionCount" value="20" /> <property name="minimumConnectionCount" value="1" /> <property name="alias" value="AutoServiceConnectionPool" /> <property name="houseKeepingTestSql" value="SELECT sysdate FROM DUAL" /> </bean>
<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.Oracle9Dialect </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop key="connection.characterEncoding">UTF-8</prop> <prop key="connection.useUnicode">true</prop> <!-- <prop key="hibernate.query.factory_class"> org.hibernate.hql.classic.ClassicQueryTranslatorFactory </prop>--> <prop key="hibernate.query.factory_class"> org.hibernate.hql.ast.ASTQueryTranslatorFactory </prop> </props> </property> <property name="mappingResources"> <list> </list> </property> </bean>
<!-- 事务定义 --> <bean id="transInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager"> <ref bean="transactionManager" /> </property> <property name="transactionAttributes"> <props> <prop key="obtainTask"> PROPAGATION_REQUIRED,-BizException </prop> <prop key="submitTask"> PROPAGATION_REQUIRED,-BizException </prop> <prop key="execute"> PROPAGATION_REQUIRED,-BizException </prop> <prop key="*">PROPAGATION_REQUIRED,-BizException</prop> </props> </property> </bean> <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> <property name="beanNames"> <value>*Service,*Loader,*Sampler</value> </property> <property name="interceptorNames"> <list> <value>transInterceptor</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有可能你某些地放catch异常后没抛出,或者就是逻辑问题~~~~~