|
A db setting/support issue rather than bug.
We can't find any configuration to fix this. As far as I can tell, DB2 has a default of 1MB for BLOB types unless you specify something different. Can we please have this patch apply to the table creation sql:
Index: kernel-impl/src/main/sql/db2/sakai_content.sql =================================================================== --- kernel-impl/src/main/sql/db2/sakai_content.sql (revision 56481) +++ kernel-impl/src/main/sql/db2/sakai_content.sql (working copy) @@ -168,7 +168,7 @@ CREATE TABLE CONTENT_RESOURCE_BODY_BINARY ( RESOURCE_ID VARCHAR (255) NOT NULL, - BODY BLOB + BODY BLOB{2G) NOT LOGGED ); CREATE UNIQUE INDEX CONT_RSRC_BB_IDX ON CONTENT_RESOURCE_BODY_BINARY Making the column 2G by default is rather large.
I would be surprised if setting no limit [ie just BLOB rather than BLOB(2G)] would not depend on a default configuration parameter in the DB2 configuration somewhere, but I could well be wrong, I have never used DB2 before, just speaking from experience with other databases. I found this page regarding increasing the max allowed LOB size in DB2 databases: http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.inst/djvtip7.htm Specifically: 1. USER LOB VALUE STORAGE Acceptable values: 1 to 2097152 Default: |10240 Update: option 8 on panel DSNTIPB DSNZPxxx: DSN6SYSP LOBVALA Specify an upper limit for the amount of storage that each user can have for storing LOB values. The specified value indicates the numbers of kilobytes. 2. SYSTEM LOB VALUE STORAGE Acceptable values: 1 to 51200 Default: 2048 Update: option 8 on panel DSNTIPB DSNZPxxx: DSN6SYSP LOBVALS Specify an upper limit for the amount of memory per system that can be used for storing LOB values. The specified value indicates the numbers of megabytes. Does that help? That documentation is for DB2 on zOS which I know this is hard to believe is an entirely different code base than what runs on Linux/windows. Sakai is targetting the Linux/windows variety. I ran this question by our DB2 consultant who has years upon years of DB2 experience to draw from. Here's his response:
The answer is that there is no way to change the DB2 default BLOB size from 1MB, and DB2 does not allow an ALTER TABLE command to extend the maximum size of an existing BLOB column. The desired limit must be specified at table creation time. You probably know this, but DB2 will attempt to allocate less than the maximum amount of space for each BLOB, so specifying an excessively large amount of storage for the maximum BLOB size will not penalize you. DB2 has two algorithms for allocating space for each BLOB value: 1. Grabbing the smallest power of 2 in kilobytes to contain the value, or 2. Grabbing the next highest number of kilobytes (requires the COMPACT option). As the size of BLOBs grows, the space difference between compact and non-compact BLOBs can become significant. So again can we please get this patched in. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is a configuration issue with your database and you need to increase the maximum allowed packet size or similar (not sure what the setting is for DB2) to something higher. By default its 1Mb.
In MySQL its the max_allowed_packet parameter that needs to be increased.
cheers.