Increase lenght of String process variables

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2011 06:30 AM
We should increase the possible size for Strings as process variables in the database! Since in most projects I see today we save XML (instead of objects at least) 255 bytes are a bit limiting 😉 And especially with Test cases it is hard to change that on-the-fly with the in memory H2.
Can we change the default to TEXT? So we have enough space?
Cheers
Bernd
- Labels:
-
Archive

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2011 07:49 AM
ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl)processEngine).getProcessEngineConfiguration(); SqlSession session = processEngineConfiguration.getDbSqlSessionFactory().getSqlSessionFactory().openSession();
Connection connection = session.getConnection();
Statement jdbcStatement = connection.createStatement();
jdbcStatement.execute("ALTER TABLE ACT_RU_VARIABLE ALTER TEXT_ CLOB");
jdbcStatement.close();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2011 11:25 AM
Basically switching to TEXT would disallow querying on those variables, so that is not a real option.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2011 10:43 AM
My expectation always was, that the database handle these nuts and bolts, so I don't have to care about 😉
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2011 11:28 AM

What do you think about the suggestion I made here: http://jira.codehaus.org/browse/ACT-236 ? Automagically uses BLOB if too long, best of both worlds?
Another solution could be the folowing:
The org.activiti.engine.impl.variable.StringType should overflow all characters between 255 and 510 into the TEXT2_ column.
StringType getValue() returns concatenated string including TEXT1_ and TEXT2_ columns.
Querying for String-values will continue to work untill 510 (eg. executionQuery.variableValueEquals('str', 'XXX')
When String is longer than 510 characters, false is returned when calling 'isAbleToStore(…)'. The String will eventually be stored by the SerializableType.
This way, strings can grow transparantly larger than the limitation. Offcourse, the limitaion for variable-value-querying should be docced.
WDYT?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2011 11:41 AM
Can all databases maybe handle a VARCHAR(10000) or something like this? That would be still much better than a blob. Actually before I have a blob I even would prefer living with the hack in the test cases and tune the database myself 😉 It always surprises me, what Oracle cannot handle 😉

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2011 12:06 PM
On the other hand, Bernd, do you actually consider querying these xmls stored in text fields by value? I think usually it's not reasonable thing to do - I mean, one usually wants to use xpath or some similar stuff then. And if you just want to retrieve/set values easily by means of get/setVariable, then I think that Frederik's proposition is OK - the fact that the value is stored in (C)Lob is then transparent.
At least this is how I understand it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2011 12:26 PM
From a usage perspective, I don't think it matters how it is stored underlying, as long as you can store long variables and short ones I guess


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2011 03:55 AM
At least serializing a String is less evil than own Java classes, but anyway I don't like it. Then I would go for the 2000 characters and document how to change this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2011 06:38 AM

