click here for details... Sakai Executive Director Position Search now open
Issue Details (XML | Word | Printable)

Key: KNL-146
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jim Eng
Reporter: Adam Hocek
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Kernel - K1

db2 file upload limit < 1 MB does not save produces: Alert: Unable to add item:

Created: 16-Jan-2009 06:58   Updated: 05-Mar-2010 02:45
Component/s: Impl
Affects Version/s: 1.0.4
Fix Version/s: 1.0.6, 1.1.0

Time Tracking:
Original Estimate: 2 days
Original Estimate - 2 days
Remaining Estimate: 2 days
Remaining Estimate - 2 days
Time Spent: Not Specified
Remaining Estimate - 2 days

File Attachments: 1. Text File SAK-15410.txt (0.5 kB)

Environment: Linux 64 bit DB2 with either Tomcat or Websphere

1.0.x Status: Resolved


 Description  « Hide
Uploading a file size >= 1 MB in Resources to DB2 causes the following error. File uploads < 1MB upload without a problem.

2009-01-16 09:57:33,409 WARN http-8080-Processor21 org.sakaiproject.content.impl.DbContentService - failed to write file from byte-array to database
org.sakaiproject.exception.ServerOverloadException id=failed to write file from byte-array to database
at org.sakaiproject.content.impl.DbContentService$DbStorage.commitResource(DbContentService.java:1726)


sakai.properties:
content.upload.max=20

 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Steve Swinsburg added a comment - 16-Jan-2009 07:03
Hi Adam,

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.

John Leasia added a comment - 16-Jan-2009 10:31
A db setting/support issue rather than bug.

John Bush added a comment - 22-Jan-2009 10:15 - edited
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

Steve Swinsburg added a comment - 23-Jan-2009 01:37
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?


John Bush added a comment - 23-Jan-2009 10:53 - edited
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.

Stephen Marquard added a comment - 02-Apr-2009 06:09
Applied patch in r59553.