cancel
Showing results for 
Search instead for 
Did you mean: 

Oracle 10 and serializable value

hf409
Champ in-the-making
Champ in-the-making
Hi all,

I want to store some data as node property. The String I am wirting has 5800 characters.
So, the data should be stored as serializable value in alf_node_properties - reading the
source code.
But it fails, because the field serializable_value is set to max 4000.
In Node.hbm.xml it is initially set to 16384. Where is this value overridden? And
can I increase it somehow?

I am using Oracle 10 xe on Ubuntu 9.0.4 and Alfresco 3.1

Thanks for any help,
Heike
9 REPLIES 9

fracat71
Champ on-the-rise
Champ on-the-rise
Hi hf409,
but are you using Community or Enterprise?
Because i have some problems ( http://forums.alfresco.com/en/viewtopic.php?f=14&t=26355 ) with Community 3.2.r2 on Oracle 11g, queries are written with IN clause with cicle variables, so if cicle is maior than 1000 it fails.

Regards

invictus9
Champ in-the-making
Champ in-the-making
But it fails, because the field serializable_value is set to max 4000.

This looks like a technical limitation of the database: variable character fields in Oracle have a maximum length of 4000 characters. To get more characters requires using a CLOB, which is a large object value used for character data, and has substantially larger upper limits. Unfortunately, managing CLOBS is an art form.

hf409
Champ in-the-making
Champ in-the-making
Hi invictus9,

but the serializable value is mapped to blob which can be 4GB as max.
So, it is limited somewhere …

And interestingly if I install it on windows, it works. So, it must be an Oracle
configuration issue AND a hibernate/Alfresco issue setting this limitation.

@fracat71
I am using enterprise 3.1.
I think the bug you mention is something different. But I am sure we will run into
this one soon. So hopefully this will be fixed ….

Thanks for any further hints,
Heike

mrogers
Star Contributor
Star Contributor
Another approach may be to avoid serializing such a big object.   Do you really have over 4K of state in your object or can you for example, split your Serializable class in a similar way that Java's String and StringBuilder classes separate responsibilities?

hf409
Champ in-the-making
Champ in-the-making
Hi mrogers,

sure I can work around it. But I am interested why it is not running, because it should.

I have seen that the SchemaBootstrap.maxStringLength is set according to database
capabilities. This max decides whether the String is written to string_value or - if
greater -  to serializable_value. But I don't understand where and why the max size
of serializable_value is overwritten.

Thanks, Heike

Another approach may be to avoid serializing such a big object.   Do you really have over 4K of state in your object or can you for example, split your Serializable class in a similar way that Java's String and StringBuilder classes separate responsibilities?

fracat71
Champ on-the-rise
Champ on-the-rise
Hi hf409,
do you have tested this situation?
1 space contains 2000 subspaces and try to list with Alfresco Explorer.
I would like to know if a problem of Community or a general limitation: queries build with circle IN clause.

Regards,
Francesco

hf409
Champ in-the-making
Champ in-the-making
Hi all,

I did some more investigation on that, but I can't find the answer …
The limit is actually at 2000 characters. Taking one more it fails.
But, I can update an existing value with whatever I want.
Looking at the hibernate log: insert fails, update passes.

Next I played a bit with alfresco gui filling the description field of uploaded
documents with my 2001 char long text message. Sometimes it works, sometimes
not. Not depending on insert or update …

Something else I am wondering is the table data fields. When I use
AlfrescoOracle9Dialect the serializable_value is of type blob. But with
AlfrescoOracle10gDialect it's a long raw - which is deprecated if I understand right.
But in both cases, it's the same behaviour.

And I tested it on windows with full featured oracle installation and it fails too.

Maybe a bug?

Thanks Heike

invictus9
Champ in-the-making
Champ in-the-making
The limit is actually at 2000 characters. Taking one more it fails.

The number "4000" continues to stand out. If the characters in the field are Unicode, at two bytes per character, 2000 characters (4000 bytes) would fit; 2001 characters would not.

You are doing some good detective work. Keep it up.

hf409
Champ in-the-making
Champ in-the-making
Hi all,

solved it after hours of trying and testing.
It's the oracle driver version.
version Oracle JDBC Driver version - "10.2.0.1.0XE" makes problems,
version Oracle JDBC Driver version - "10.2.0.3.0" works.

Thanks to all who read my postings and gave hints.
Heike