Home org.springframework.orm.jpa.JpaSystemException: java.sql.SQLRecoverableException: No more data to read from socket;
Reply: 0

org.springframework.orm.jpa.JpaSystemException: java.sql.SQLRecoverableException: No more data to read from socket;

user5160
1#
user5160 Published in July 21, 2018, 1:42 pm

org.springframework.orm.jpa.JpaSystemException: java.sql.SQLRecoverableException: No more data to read from socket; nested exception is javax.persistence.PersistenceException: java.sql.SQLRecoverableException: No more data to read from socket at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:418) at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:227) at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:521) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy75.getDataSource(Unknown Source) at com.ocr.user.manager.TestBean.getDataSource(TestBean.java:989)

@Service("testBean")
@Transactional(propagation = Propagation.REQUIRED)
public class TestBean implements ...{

@Autowired
@Qualifier("dataSource")
private DataSource dataSource;

......

public DataSource getDataSource() throws Exception{
        return dataSource;
    }
......

}   

applicationContext.xml
------------------------

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">

<context:component-scan base-package="com.ocr.user" />
<bean  class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

<bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="persistenceUnitName" value="EASEDBUSER" />
        <property name="jpaVendorAdapter">
            <bean
                class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="databasePlatform" value="${jdbc.dialect}" />
            </bean>
        </property>
</bean>

<context:property-placeholder location="classpath*:catalina.properties" ignore-unresolvable="true"/>

<!--Apache DBCP configuration -->

 <bean id="dataSource"
        class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${jdbc.driverClassName}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
    <property name="removeAbandonedTimeout" value="180"/>
    <property name="removeAbandoned" value="true"/>
    <property name="logAbandoned" value="true"/>
    <property name="timeBetweenEvictionRunsMillis" value="5000"/>
    <property name="minEvictableIdleTimeMillis" value="900000"/>
    <property name="maxActive" value="20"/>
    <property name="maxIdle" value="4"/>
</bean>

<bean id="transactionManager"
        class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>

<tx:annotation-driven  />

</beans>

Above is the sample code used in my application. The reported issue is getting generated intermittently. Please let me know the reason for this issue

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.324997 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO