• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.2.7
    • 2.2.6
    • None

      For details, please refer to the support ticket below:

      https://support.atlassian.com/browse/CSP-4584

      Error Message: (HibernateTemplate): data integrity violated by SQL ''; nested exception is com.ibm.db2.jcc.b.SqlException: The value of a host variable in the EXECUTE or OPEN statement is too large for its corresponding use.

            [CONFSERVER-6607] DB2 error when BLOB data too large (Confluence page)

            Hi Kim,

            Thanks for pointing out this limitation. I just confirmed this after re-reading the relevant chapter in the db2 manual.

            Also have added this information to the docs:

            http://confluence.atlassian.com/display/DOC/Known+Issues+For+All+Databases

            Regards,
            Ivan

            Ivan Benko [Atlassian] added a comment - Hi Kim, Thanks for pointing out this limitation. I just confirmed this after re-reading the relevant chapter in the db2 manual. Also have added this information to the docs: http://confluence.atlassian.com/display/DOC/Known+Issues+For+All+Databases Regards, Ivan

            Kim Tang added a comment -

            Increasing the BLOBs size to larger than 1GB broke Confluence during database setup on DB2. DB2 does not allow transaction logging of BLOBs larger than 1GB.

            2006-08-14 16:02:22,494 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: create table BODYCONTENT (BODYCONTENTID bigint not null, BODY clob(2147483647), CONTENTID bigint, primary key (BODYCONTENTID))
            2006-08-14 16:02:22,571 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -355, SQLSTATE: 42993, SQLERRMC: BODY
            2006-08-14 16:02:55,828 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: create index body_content_idx on BODYCONTENT (CONTENTID)
            2006-08-14 16:02:55,921 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT
            2006-08-14 16:02:56,030 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: alter table BODYCONTENT add constraint FKA898D4778DD41734 foreign key (CONTENTID) references CONTENT
            2006-08-14 16:02:56,108 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT
            2006-08-14 16:05:19,808 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: create table BODYCONTENT (BODYCONTENTID bigint not null, BODY clob(2147483647), CONTENTID bigint, primary key (BODYCONTENTID))
            2006-08-14 16:05:19,824 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -355, SQLSTATE: 42993, SQLERRMC: BODY
            2006-08-14 16:05:39,740 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: create index body_content_idx on BODYCONTENT (CONTENTID)
            2006-08-14 16:05:39,787 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT
            2006-08-14 16:05:39,818 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: alter table BODYCONTENT add constraint FKA898D4778DD41734 foreign key (CONTENTID) references CONTENT
            2006-08-14 16:05:39,834 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT
            2006-08-14 16:05:44,696 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT
            2006-08-14 16:05:44,696 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT
            2006-08-14 16:05:44,727 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;JIRA.BODYCONTENT
            2006-08-14 16:05:44,727 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;JIRA.BODYCONTENT
            2006-08-14 16:05:44,758 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;JIRA.BODYCONTENT
            2006-08-14 16:05:44,758 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;JIRA.BODYCONTENT

            Kim Tang added a comment - Increasing the BLOBs size to larger than 1GB broke Confluence during database setup on DB2. DB2 does not allow transaction logging of BLOBs larger than 1GB. 2006-08-14 16:02:22,494 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: create table BODYCONTENT (BODYCONTENTID bigint not null, BODY clob(2147483647), CONTENTID bigint, primary key (BODYCONTENTID)) 2006-08-14 16:02:22,571 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -355, SQLSTATE: 42993, SQLERRMC: BODY 2006-08-14 16:02:55,828 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: create index body_content_idx on BODYCONTENT (CONTENTID) 2006-08-14 16:02:55,921 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT 2006-08-14 16:02:56,030 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: alter table BODYCONTENT add constraint FKA898D4778DD41734 foreign key (CONTENTID) references CONTENT 2006-08-14 16:02:56,108 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT 2006-08-14 16:05:19,808 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: create table BODYCONTENT (BODYCONTENTID bigint not null, BODY clob(2147483647), CONTENTID bigint, primary key (BODYCONTENTID)) 2006-08-14 16:05:19,824 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -355, SQLSTATE: 42993, SQLERRMC: BODY 2006-08-14 16:05:39,740 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: create index body_content_idx on BODYCONTENT (CONTENTID) 2006-08-14 16:05:39,787 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT 2006-08-14 16:05:39,818 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute Unsuccessful: alter table BODYCONTENT add constraint FKA898D4778DD41734 foreign key (CONTENTID) references CONTENT 2006-08-14 16:05:39,834 ERROR [hibernate.tool.hbm2ddl.SchemaExport] execute DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT 2006-08-14 16:05:44,696 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT 2006-08-14 16:05:44,696 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: JIRA.BODYCONTENT 2006-08-14 16:05:44,727 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;JIRA.BODYCONTENT 2006-08-14 16:05:44,727 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;JIRA.BODYCONTENT 2006-08-14 16:05:44,758 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;JIRA.BODYCONTENT 2006-08-14 16:05:44,758 ERROR [sf.hibernate.util.JDBCExceptionReporter] logExceptions DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-204;42704;JIRA.BODYCONTENT

            Increased the CustomClobType in BodyContent.hbm.xml field length to 2^31 - 1 to allow storing of BLOBs up to the size of 2 Gb.

            <property name="body" type="com.atlassian.confluence.core.persistence.hibernate.CustomClobType" update="true" insert="true"
            column="BODY" length="2147483647" />

            Ivan Benko [Atlassian] added a comment - Increased the CustomClobType in BodyContent.hbm.xml field length to 2^31 - 1 to allow storing of BLOBs up to the size of 2 Gb. <property name="body" type="com.atlassian.confluence.core.persistence.hibernate.CustomClobType" update="true" insert="true" column="BODY" length="2147483647" />

            I used the DB2 generated commands below to increase the size to 500,000 bytes which seemed to resolve the issue.

            CONNECT TO CONFLUEN USER "db2inst1" USING ;
            CALL SYSPROC.ALTOBJ ( 'APPLY_CONTINUE_ON_ERROR', 'CREATE TABLE DB2INST1.BODYCONTENT ( BODYCONTENTID BIGINT NOT NULL , BODY CLOB (500000 ) LOGGED NOT COMPACT , CONTENTID BIGINT ) IN USERSPACE1 ', 1, ? );
            ;
            CONNECT RESET;

            Okan Karakis added a comment - I used the DB2 generated commands below to increase the size to 500,000 bytes which seemed to resolve the issue. CONNECT TO CONFLUEN USER "db2inst1" USING ; CALL SYSPROC.ALTOBJ ( 'APPLY_CONTINUE_ON_ERROR', 'CREATE TABLE DB2INST1.BODYCONTENT ( BODYCONTENTID BIGINT NOT NULL , BODY CLOB (500000 ) LOGGED NOT COMPACT , CONTENTID BIGINT ) IN USERSPACE1 ', 1, ? ); ; CONNECT RESET;

              Unassigned Unassigned
              ivan@atlassian.com Ivan Benko [Atlassian]
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: