3 Replies Latest reply on Nov 19, 2002 5:21 PM by 3004

    java.sql.SQLException: Io exception: Socket closed

    3004
      I am getting a Socket closed IO exception on a project I am working on.
      The problem seems to occur somewhat randomly during a run of a command
      line program. Other somewhat simpler programs that use the same JDO
      enhanced objects work just fine, although the program that breaks is
      somewhat longer and more complex. I have tried it with both 2.3.4 and 2.4
      RC1 and got the same error.

      I am connecting to an Oracle 9i database using their thin client driver
      and am using the LocalCache datacache. I have not set any connection
      timeout parameters anywhere, but that seems like it may be the problem.
      I've gotten the error with both Sun's 1.3.1 JVM and 1.4.1 JVM and with
      Oracle's 1.4 and pre-1.4 JDBC driver.

      Here is the stack trace that gets thrown (from 2.3.4):
      ------------------------------------------------------
      java.sql.SQLException: Io exception: Socket closed

      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.<init>(OracleStatement.java:389) at
      oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:772)
      at
      oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:712)
      at
      com.solarmetric.kodo.impl.jdbc.datasource.ConnectionImpl.getStatement(ConnectionImpl.java:159)
      at
      com.solarmetric.kodo.impl.jdbc.datasource.ConnectionImpl.createStatement(ConnectionImpl.java:116)
      at
      com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCStoreManager.java:641)
      at
      com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java:150)
      at
      com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:580)
      at
      com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:469)
      at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:440) at
      com.solarmetric.kodo.query.QueryImpl$SynchronizedQuery.execute(QueryImpl.java:1356)
      at
      net.sundog.products.ItemTypePeer.findByParentAndBM(ItemTypePeer.java:107)



      Thanks,
      Nathan
        • 1. Re: java.sql.SQLException: Io exception: Socket closed
          3004
          Are you using optimistic or pessimistic transactions?

          -Patrick

          Nathan Voxland wrote:
          I am getting a Socket closed IO exception on a project I am working on.
          The problem seems to occur somewhat randomly during a run of a command
          line program. Other somewhat simpler programs that use the same JDO
          enhanced objects work just fine, although the program that breaks is
          somewhat longer and more complex. I have tried it with both 2.3.4 and 2.4
          RC1 and got the same error.

          I am connecting to an Oracle 9i database using their thin client driver
          and am using the LocalCache datacache. I have not set any connection
          timeout parameters anywhere, but that seems like it may be the problem.
          I've gotten the error with both Sun's 1.3.1 JVM and 1.4.1 JVM and with
          Oracle's 1.4 and pre-1.4 JDBC driver.

          Here is the stack trace that gets thrown (from 2.3.4):
          ------------------------------------------------------
          java.sql.SQLException: Io exception: Socket closed

          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.(OracleStatement.java:389) at
          oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:772)
          at
          oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:712)
          at
          com.solarmetric.kodo.impl.jdbc.datasource.ConnectionImpl.getStatement(ConnectionImpl.java:159)
          at
          com.solarmetric.kodo.impl.jdbc.datasource.ConnectionImpl.createStatement(ConnectionImpl.java:116)
          at
          com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCStoreManager.java:641)
          at
          com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java:150)
          at
          com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:580)
          at
          com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:469)
          at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:440) at
          com.solarmetric.kodo.query.QueryImpl$SynchronizedQuery.execute(QueryImpl.java:1356)
          at
          net.sundog.products.ItemTypePeer.findByParentAndBM(ItemTypePeer.java:107)



          Thanks,
          Nathan
          --
          Patrick Linskey pcl@solarmetric.com
          SolarMetric Inc. http://www.solarmetric.com

          • 2. Re: java.sql.SQLException: Io exception: Socket closed
            3004
            I'm using optimistic transactions.

            Here is (most of) my kodo.properties file:

            javax.jdo.PersistenceManagerFactoryClass: com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory
            javax.jdo.option.RetainValues: true
            javax.jdo.option.RestoreValues: true
            javax.jdo.option.Optimistic: true
            javax.jdo.option.NontransactionalWrite: false
            javax.jdo.option.NontransactionalRead: true
            javax.jdo.option.Multithreaded: true
            javax.jdo.option.MsWait: 5000
            javax.jdo.option.MinPool: 1
            javax.jdo.option.MaxPool: 80
            javax.jdo.option.IgnoreCache: false
            javax.jdo.option.ConnectionURL=@DATABASE_URL@
            javax.jdo.option.ConnectionUserName=@DATABASE_USER@
            javax.jdo.option.ConnectionPassword=@DATABASE_PASSWORD@
            javax.jdo.option.ConnectionDriverName: @DATABASE_DRIVER@

            com.solarmetric.kodo.LicenseKey=XXXXXXXXXXXXXXXXXXXXXXXX
            com.solarmetric.kodo.impl.jdbc.DictionaryClass: com.solarmetric.kodo.impl.jdbc.schema.dict.OracleDictionary
            com.solarmetric.kodo.impl.jdbc.WarnOnPersistentTypeFailure: true
            com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass: com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory
            com.solarmetric.kodo.impl.jdbc.FlatInheritanceMapping: true
            com.solarmetric.kodo.impl.jdbc.AutoReturnTimeout: 10
            com.solarmetric.kodo.Logger: stdout
            com.solarmetric.kodo.EnableQueryExtensions: false
            com.solarmetric.kodo.DefaultFetchThreshold: 30
            com.solarmetric.kodo.DefaultFetchBatchSize: 10
            com.solarmetric.kodo.DataCacheClass: com.solarmetric.kodo.runtime.datacache.plugins.LocalCache
            com.solarmetric.kodo.CacheReferenceSize: 100000

            com.solarmetric.kodo.impl.jdbc.PersistentTypes=XXXXXXXXXXXXXXXXXXXXXX



            On Mon, 18 Nov 2002 20:02:00 -0600, Patrick Linskey wrote:
            Are you using optimistic or pessimistic transactions?

            -Patrick

            Nathan Voxland wrote:
            I am getting a Socket closed IO exception on a project I am working on.
            The problem seems to occur somewhat randomly during a run of a command
            line program. Other somewhat simpler programs that use the same JDO
            enhanced objects work just fine, although the program that breaks is
            somewhat longer and more complex. I have tried it with both 2.3.4 and
            2.4 RC1 and got the same error.

            I am connecting to an Oracle 9i database using their thin client driver
            and am using the LocalCache datacache. I have not set any connection
            timeout parameters anywhere, but that seems like it may be the problem.
            I've gotten the error with both Sun's 1.3.1 JVM and 1.4.1 JVM and with
            Oracle's 1.4 and pre-1.4 JDBC driver.

            Here is the stack trace that gets thrown (from 2.3.4):
            ------------------------------------------------------
            java.sql.SQLException: Io exception: Socket closed

            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.(OracleStatement.java:389) at
            oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:772)
            at
            oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:712)
            at
            com.solarmetric.kodo.impl.jdbc.datasource.ConnectionImpl.getStatement(ConnectionImpl.java:159)
            at
            com.solarmetric.kodo.impl.jdbc.datasource.ConnectionImpl.createStatement(ConnectionImpl.java:116)
            at
            com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCStoreManager.java:641)
            at
            com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java:150)
            at
            com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:580)
            at
            com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:469)
            at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:440) at
            com.solarmetric.kodo.query.QueryImpl$SynchronizedQuery.execute(QueryImpl.java:1356)
            at
            net.sundog.products.ItemTypePeer.findByParentAndBM(ItemTypePeer.java:107)



            Thanks,
            Nathan
            • 3. Re: java.sql.SQLException: Io exception: Socket closed
              3004
              You might want to try switching to datastore transactions, either all
              the time or just for the one transaction. When using datastore
              transactions, we hold on to connections for longer periods of time,
              which could cause Oracle to be happier about its connections.

              Could you also send me the log you get? If you send the 2.4.0 log,
              please turn on JDBC logging -- set the
              com.solarmetric.kodo.impl.jdbc.JDBC log channel to INFO in the
              log4j.properties file.

              -Patrick

              Nathan Voxland wrote:
              I'm using optimistic transactions.

              Here is (most of) my kodo.properties file:

              javax.jdo.PersistenceManagerFactoryClass:
              com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory
              javax.jdo.option.RetainValues: true
              javax.jdo.option.RestoreValues: true
              javax.jdo.option.Optimistic: true
              javax.jdo.option.NontransactionalWrite: false
              javax.jdo.option.NontransactionalRead: true
              javax.jdo.option.Multithreaded: true
              javax.jdo.option.MsWait: 5000
              javax.jdo.option.MinPool: 1
              javax.jdo.option.MaxPool: 80
              javax.jdo.option.IgnoreCache: false
              javax.jdo.option.ConnectionURL=@DATABASE_URL@
              javax.jdo.option.ConnectionUserName=@DATABASE_USER@
              javax.jdo.option.ConnectionPassword=@DATABASE_PASSWORD@
              javax.jdo.option.ConnectionDriverName: @DATABASE_DRIVER@

              com.solarmetric.kodo.LicenseKey=XXXXXXXXXXXXXXXXXXXXXXXX
              com.solarmetric.kodo.impl.jdbc.DictionaryClass:
              com.solarmetric.kodo.impl.jdbc.schema.dict.OracleDictionary
              com.solarmetric.kodo.impl.jdbc.WarnOnPersistentTypeFailure: true
              com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass:
              com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory
              com.solarmetric.kodo.impl.jdbc.FlatInheritanceMapping: true
              com.solarmetric.kodo.impl.jdbc.AutoReturnTimeout: 10
              com.solarmetric.kodo.Logger: stdout
              com.solarmetric.kodo.EnableQueryExtensions: false
              com.solarmetric.kodo.DefaultFetchThreshold: 30
              com.solarmetric.kodo.DefaultFetchBatchSize: 10
              com.solarmetric.kodo.DataCacheClass:
              com.solarmetric.kodo.runtime.datacache.plugins.LocalCache
              com.solarmetric.kodo.CacheReferenceSize: 100000

              com.solarmetric.kodo.impl.jdbc.PersistentTypes=XXXXXXXXXXXXXXXXXXXXXX



              On Mon, 18 Nov 2002 20:02:00 -0600, Patrick Linskey wrote:

              Are you using optimistic or pessimistic transactions?

              -Patrick

              Nathan Voxland wrote:

              I am getting a Socket closed IO exception on a project I am working on.
              The problem seems to occur somewhat randomly during a run of a command
              line program. Other somewhat simpler programs that use the same JDO
              enhanced objects work just fine, although the program that breaks is
              somewhat longer and more complex. I have tried it with both 2.3.4 and
              2.4 RC1 and got the same error.

              I am connecting to an Oracle 9i database using their thin client driver
              and am using the LocalCache datacache. I have not set any connection
              timeout parameters anywhere, but that seems like it may be the problem.
              I've gotten the error with both Sun's 1.3.1 JVM and 1.4.1 JVM and with
              Oracle's 1.4 and pre-1.4 JDBC driver.

              Here is the stack trace that gets thrown (from 2.3.4):
              ------------------------------------------------------
              java.sql.SQLException: Io exception: Socket closed

              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.(OracleStatement.java:389) at
              oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:772)
              at
              oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:712)
              at
              com.solarmetric.kodo.impl.jdbc.datasource.ConnectionImpl.getStatement(ConnectionImpl.java:159)
              at
              com.solarmetric.kodo.impl.jdbc.datasource.ConnectionImpl.createStatement(ConnectionImpl.java:116)
              at
              com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCStoreManager.java:641)
              at
              com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java:150)
              at
              com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:580)
              at
              com.solarmetric.kodo.query.QueryImpl.executeWithArray(QueryImpl.java:469)
              at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:440) at
              com.solarmetric.kodo.query.QueryImpl$SynchronizedQuery.execute(QueryImpl.java:1356)
              at
              net.sundog.products.ItemTypePeer.findByParentAndBM(ItemTypePeer.java:107)
              Thanks,
              Nathan
              --
              Patrick Linskey pcl@solarmetric.com
              SolarMetric Inc. http://www.solarmetric.com