4 Replies Latest reply on Oct 26, 2006 10:36 AM by Nicola Scendoni

    CMS errors on Oracle10g

    Jerry Lacy Newbie

      Hello,

      We have run into an issue running against Oracle10g. When attempting to upload an entry into the CMS that is larger than 64K, we are seeing the errors below. This occurs when uploading a single file or an archive via CMSAdminPortlet or when doing an XML import via JackRabbit. It is particularly nasty in that it seems to hose the entire DataSource (see the Close Connection exceptions below)?an app server restart is required. Files less than 64K aren?t a problem. I?ve tried various file types, a couple of different driver versions, and two different database instances just to be sure.

      I can run the same server instance against MySQL and everything works fine.

      Any ideas?

      (using v2.4 final (source download bundle), JBoss AS 4.0.4GA, Oracle 10g (10.2.0.1.), Oracle thin JDBC Driver version "10.2.0.2.0", JDK 1.5.0, WindowsXP)

      Thanks in advance,

      Jerry


      2006-09-26 11:39:34,796 ERROR [org.hibernate.event.def.AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      ...
      Caused by: java.sql.BatchUpdateException: Io exception: Read error
      at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
      at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10698)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:517)
      ...
      2006-09-26 11:39:34,828 ERROR [org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager] failed to read binary data: 957f3585-a275-46e6-ae4e-1967fbe9acad/{http://www.jcp.org/jcr/1.0}data[0]
      org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      ...
      Caused by: java.sql.BatchUpdateException: Io exception: Read error
      at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
      at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10698)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:517)
      ...
      2006-09-26 11:39:34,843 ERROR [org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager] failed to write property state: 957f3585-a275-46e6-ae4e-1967fbe9acad/{http://www.jcp.org/jcr/1.0}data
      org.apache.jackrabbit.core.state.ItemStateException: failed to read binary data: 957f3585-a275-46e6-ae4e-1967fbe9acad/{http://www.jcp.org/jcr/1.0}data[0]
      at org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager$DbBLOBStore.get(HibernatePersistenceManager.java:1011)
      at org.apache.jackrabbit.core.state.util.Serializer.serialize(Serializer.java:219)
      at org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager.store(HibernatePersistenceManager.java:624)
      ...
      Caused by: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      ...
      Caused by: java.sql.BatchUpdateException: Io exception: Read error
      at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:343)
      at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10698)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:517)
      ...
      2006-09-26 11:39:34,906 INFO [STDOUT] Hibernate: select wspnode0_.NODE_DATA as col_0_0_ from jbp_cms_wsp_node wspnode0_ where NODE_ID=?
      2006-09-26 11:39:34,906 ERROR [org.hibernate.util.JDBCExceptionReporter] Closed Connection
      2006-09-26 11:39:34,906 ERROR [org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager] failed to read node state: 89035540-55a3-4b20-95a6-7264a7ab1799
      org.hibernate.exception.GenericJDBCException: could not execute query
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      ...
      Caused by: java.sql.SQLException: Closed Connection
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
      at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:849)
      ...
      2006-09-26 11:39:34,921 ERROR [org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager] failed to read property state: 89035540-55a3-4b20-95a6-7264a7ab1799/{http://www.jcp.org/jcr/1.0}lastModified
      org.hibernate.exception.GenericJDBCException: could not execute query
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      ...
      Caused by: java.sql.SQLException: Closed Connection
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
      at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:849)
      ...


        • 1. Re: CMS errors on Oracle10g
          Peter Johnson Master

          This could be related to the problem noted in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88506.

          There is a JIRA issue, http://jira.jboss.com/jira/browse/JBPORTAL-983 scheduled to be fixed in Portal 2.6.

          • 2. Re: CMS errors on Oracle10g
            Roy Russo Master

            Yep. This is a problem with certain drivers in certain DBs, where they close the stream on a resource.

            I have it working in mysql, but oracle's brilliantly coded drivers are still an enigma.

            • 3. Re: CMS errors on Oracle10g
              Nicola Scendoni Newbie

               

              "PeterJ" wrote:
              This could be related to the problem noted in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88506.

              There is a JIRA issue, http://jira.jboss.com/jira/browse/JBPORTAL-983 scheduled to be fixed in Portal 2.6.



              I need to fix this problem. Have you got any ideas about it?
              do you think that the problem is related to JackRabbit or Hibernate?
              If i write a custom hibernate OracleBlobType can i solve the problem?

              • 4. Re: CMS errors on Oracle10g
                Nicola Scendoni Newbie

                 

                "nscendoni" wrote:
                "PeterJ" wrote:
                This could be related to the problem noted in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88506.

                There is a JIRA issue, http://jira.jboss.com/jira/browse/JBPORTAL-983 scheduled to be fixed in Portal 2.6.



                I need to fix this problem. Have you got any ideas about it?
                do you think that the problem is related to JackRabbit or Hibernate?
                If i write a custom hibernate OracleBlobType can i solve the problem?


                I found a workaround using jackrabbit 1.1 and the OraclePersistenceManager boundled with this version instead of the HibernatePersistenceManager in JBoss Portal.
                The following steps are required:
                1. replace portal-cms.sar/jackrabbit-core-1.0.jar with portal-cms.sar/jackrabbit-core-1.1.jar (from jackrabbit.apache.org)
                2. replace in portal/cms/conf/workspaces/default/workspace.xml and in portal-cms.sar/META-INF/jboss-service.xml any occurence of
                <FileSystem class="org.jboss.portal.cms.hibernate.HibernateStore">
                 <param name="schemaObjectPrefix" value="CMSEntry"/>
                 <param name="JNDIName" value="java:portal/cms/CMSSessionFactory"/>
                 </FileSystem>

                with
                <FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
                 <param name="schemaObjectPrefix" value="jcms_"/>
                 <param name="url" value="jdbc:oracle:oci:@sid"/>
                 <param name="user" value="username"/>
                 <param name="password" value="password"/>
                


                and
                <PersistenceManager class="org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager">
                 <param name="schemaObjectPrefix" value="WSP"/>
                 <param name="JNDIName" value="java:portal/cms/CMSSessionFactory"/>
                 <param name="externalBLOBs" value="false"/>
                 </PersistenceManager>

                with
                <PersistenceManager class="org.apache.jackrabbit.core.state.db.OraclePersistenceManager">
                 <param name="schemaObjectPrefix" value="jcms_"/>
                 <param name="url" value="jdbc:oracle:oci:@sid"/>
                 <param name="user" value="username"/>
                 <param name="password" value="password"/>
                 <param name="externalBLOBs" value="false"/>
                 </PersistenceManager>





                Naturally the "right" solutions will be debugging the org.jboss.portal.cms.hibernate.state.HibernatePersistenceManager and the org.apache.jackrabbit.core.fs.db.OracleFileSystem classes... good luck!