开发者社区> 问答> 正文

无法从套接字读取更多的数据:报错

Spring+Hibernate 操作Oracle出现 java.sql.SQLException: 无法从套接字读取更多的数据:报错

具体配置如下:

spring中:

 <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor" />
 <bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true">
  <property name="nativeJdbcExtractor">
     <ref bean="nativeJdbcExtractor" />
  </property>
 </bean>




<!-- 3、 配置sessionfactory -->
<bean id="sessionFacty" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSc"></property>
    
    <property name="lobHandler" ref="oracleLobHandler"></property>
..

</bean>


hbm.xml中

    <property name="blogContent" type="org.springframework.orm.hibernate3.support.ClobStringType">
            <column name="BLOG_CONTENT"  />
   </property>


执行save方法出现:

org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed
	org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:677)
	org.springframework.transaction.support.AbstractPlatformTransactionManager.doRollbackOnCommitException(AbstractPlatformTransactionManager.java:873)
	org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:760)
	org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
	org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
	org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
org.hibernate.TransactionException: JDBC rollback failed
	org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:170)
	org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:674)
	org.springframework.transaction.support.AbstractPlatformTransactionManager.doRollbackOnCommitException(AbstractPlatformTransactionManager.java:873)
	org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:760)
	org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
	org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
	org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	$Proxy2.saveOrUpdateBlog(Unknown Source)
java.sql.SQLException: 无法从套接字读取更多的数据
	oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
	oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
	oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
	oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:963)
	oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
	oracle.jdbc.ttc7.Ocommoncall.receive(Ocommoncall.java:104)
	oracle.jdbc.ttc7.TTC7Protocol.rollback(TTC7Protocol.java:487)
	oracle.jdbc.driver.OracleConnection.rollback(OracleConnection.java:1376)

这是什么原因啊。。。。 求教大神啊

展开
收起
kun坤 2020-06-07 21:06:34 2740 0
1 条回答
写回答
取消 提交回答
  • 事务呢?######事物我统一配置管理的######可能Oracle连接断开了?######连接没断啊,只要操作clob字段就报这错误######

    <tx:advice id="txAdvice" transaction-manager="transactionManager">
       <tx:attributes>
           <tx:method name="find*" propagation="NOT_SUPPORTED"
           isolation="READ_COMMITTED" read-only="true"/>
           <tx:method name="query*" propagation="NOT_SUPPORTED"
           isolation="READ_COMMITTED" read-only="true"/>
           <tx:method name="" propagation="REQUIRED"
           isolation="READ_COMMITTED" />
       </tx:attributes>
    </tx:advice>


    <!-- 7、用aop将事物配置到service层 -->
    <aop:config>
        <aop:pointcut expression="execution(
    com.yin.blog.service...(..))" id="curd"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="curd"/>
    </aop:config>

    2020-06-07 21:06:40
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载