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)
这是什么原因啊。。。。 求教大神啊
事务呢?######事物我统一配置管理的######可能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>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。