MYSQL AND BLOB FIELD SIZE

Using the Imixs Workflow together with mysql can lead into a problem with large data stored in a single workitem. The Database schema use by the Imixs Workflow will be generated automatically by the OR-Mapper (e.g. Toplink, Eclipslink). This is all done well. But the Data table ‘EntityData’ used by the Imixs Workflow engine contains the column ‘itemcollection’. This column will store all undstuctured data. And in some cases this data can become very large. For example when storing a attachment into a workitem the field can be serveral MB in size. The default field type in mysql is ‘BLOB’. And this fieldtype is restricted to a maximum size of 64KB. So the Imixs workflow engine can not store large workitems. This will result into a SQL Execption.

To avoid this problem the Datatype can be changed from ‘BLOB’ to ‘MEDIUMBLOB’ (=16MB) or ‘LONGBLOB’ (=4GB). This can be done with the MySQL Admin Client or from the MySQL command line.

ALTER TABLE <Tabellenname> CHANGE <columnname> <columnname> LONGBLOB;

To change the datatype for a example database ‘imixsdb’ use the following command:

ALTER TABLE ENTITYDATA CHANGE ITEMCOLLECTION ITEMCOLLECTION LONGBLOB;

 

Leave a Reply