Wiki source code of ERAttachment Framework

Version 39.1 by Kieran Kelleher on 2010/04/30 11:48

Show last authors
1 If you are using Oracle with ERAttachment, the table creation will fail because one of the attributes is called "size" and this is a reserved word in Oracle DB. To fix that problem, add this to your Properties :
2
3 {{code}}
4
5 er.extensions.ERXModelGroup.ERAttachment.size.columnName=attachmentSize
6
7 {{/code}}
8
9 If you want to use ERAttachment without using ERXApplication, you need to register the request handler in your Application class with :
10
11 {{code}}
12
13 ERAttachmentPrincipal.sharedInstance(ERAttachmentPrincipal.class).finishInitialization();
14
15 {{/code}}
16
17 == MySQL and ERAttachmentData BLOB size ==
18
19 The prototype for ERAttachmentData.data is 'blob', and the blob proto for MySQL is BLOB when it should really be LONGBLOB. In MySQL a BLOB is on 65K+, a MEDIUMBLOB is up to 64MB and a LONGBLOB is up to 4GB. FrontBase, for example, has only one type, BLOB for binary large objects and it is defined as 4GB (4^^32 bytes). So if you don't want to think about it, then use LONGBLOB in MySQL. If you want to limit the size of what someone can upload and 64MB is the biggest attachment you ever want to be accepted into the database, use MEDIUMBLOB.^^
20
21 Changing the migration-generated tables is easy, for example:
22
23 {{code}}
24
25 ALTER TABLE ERAttachmentData MODIFY data MEDIUMBLOB;
26
27 or
28
29 ALTER TABLE ERAttachmentData MODIFY data LONGBLOB;
30
31 {{/code}}
32
33 Meanwhile, when [[this>>http://issues.objectstyle.org/jira/browse/WONDER-528]] patch gets applied, new users of blob prototype for new table SQL generation will be saved anguish and debugging grief!
34 [[http://issues.objectstyle.org/jira/browse/WONDER-528]]