Io异常:软件导致连接中止:套接字写入错误

时间:2014-04-23 14:23:24

标签: java hibernate sockets

当我连接到特定的Oracle数据库时,我的代码中出现软件导致连接中止:套接字写入错误。与其他DB一起工作正常。以下是错误

WARN - SQL Error: 17002, SQLState: null
org.hibernate.exception.GenericJDBCException: could not execute query 
org.hibernate.exception.SQLStateConverter.handledNonSpecificException   org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.loader.Loader.doList(Loader.java:2536)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
org.hibernate.loader.Loader.list(Loader.java:2271)
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
failed org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException                at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2536)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionCaused by:   
 **java.sql.SQLException: Io exception: Software caused connection abort: socket write error**
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:648)
at oracle.jdbc.driver.OraclePreparedStatement.privateClose(OraclePreparedStatement.java:485)
at oracle.jdbc.driver.OraclePreparedStatement.close(OraclePreparedStatement.java:393)
at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:563)
at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:291)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:307)
at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:234)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1967)
at org.hibernate.loader.Loader.doQuery(Loader.java:802)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)

我有以下方法使用hibernate Criteria

public List<SET> findMaxProcessId(Session session, Site logS) {
        try {
        List<SET> listRackIdProcessed = new ArrayList<SET>();
        List<Integer> listMax= new ArrayList<Integer>();
        List<CInvoicingProcessResult> IistMax= findRackIdWithMaxInv(session, logS);
            // session.getTransaction().setTimeout(120);
            Criteria crit = session.createCriteria(InvoicingProcess.class);
            manageListInvProcessId(crit, listMax); 
                   //Here it check if List is greater than 1000 if yes it divides it in subList
            crit.setProjection(Projections.distinct(Projections.property("set")));
            listProcessed = crit.list();  // **Getting ERROR HERE**
            // session.getTransaction().commit();
        }
        return listProcessed;
    } catch (RuntimeException re) {
        log.error("failed", re);
        throw re;
    }
}

我也尝试过使用session.getTransaction()。setTimeout(120);但也没有用。

Why is this error Occuring when i try to get > crit.list()

我无法找到任何解决方案。

0 个答案:

没有答案