1 Reply Latest reply on Aug 8, 2003 6:44 AM by mfrost

    Storing CMP Clob field fails for > 4000 characters

    mfrost

      My CMP EntityBean has a Clob field. I can read from it fine. I can write OK provided the characters < 4000. Greater than this and the column will be set to null.

      Code extract:
      public abstract class XmlCompanyBean implements EntityBean {
      ////////////////////////////////////////////////////////////////////////////
      // ejb accessor methods for persistent fields...
      //

      public abstract String getXml();
      public abstract void setXml(String xml);

      etc....


      My jbosscmp-jdbc.xml file contains....

      <cmp-field>
      <field-name>xml</field-name>
      <column-name>XML</column-name>
      <jdbc-type>CLOB</jdbc-type>
      <sql-type>CLOB</sql-type>
      </cmp-field>

      I noticed by turning up the log4j settings the following:

      16:22:00,139 DEBUG [XmlCompanyRW] Executing SQL: UPDATE XML_COMPANY SET XML=? WHERE CACHE_KEY=?

      This implies JBoss isn't using streaming to update the clob column (Normally with Oracle Clobs you have to use Lob locators and stream manipulation to update/insert clobs - just an UPDATE clob-column won't do it)

      Can you tell me how you got this to work? Is there a special setting I need in standardjbosscmp-jdbc.xml. I notice the shipped copy of this file has no mention of Clobs but it does on Blobs - do I need to add something?

      JBoss version: jboss-3.2.1_tomcat-4.1.24
      Oracle version: 8.1.7.4
      JDBC version: 9.2.0.2

      Any pointers or clues would be very much appreciated if others have got Clobs to work.

      Many thanks

      Mark