cancel
Showing results for 
Search instead for 
Did you mean: 

Length of custom property d:text

richardgunderse
Champ in-the-making
Champ in-the-making
Hi

I have a custom property defined as d:text.

I am trying to store a huge value in it (100,000 chars) but I'm getting a Hibernate exception saying it's too long.

Is there a max length for d:text, and can it be dropped altogether? Having no max length constraint at all would be the best for me, as the value is of variable length.

Or, is there a better datatype for this kind of value that I could use, other than d:text?

Thanks
5 REPLIES 5

jpfi
Champ in-the-making
Champ in-the-making
Hi,
I don't know the max length of d:text, probably this depends on your DBMS…any Hibernate Guru available?
But I would store 100.000 chars in an txt file as an d:content attribute.
Cheers, Jan

richardgunderse
Champ in-the-making
Champ in-the-making
Thanks for the reply Jan - much appreciated

I'll give it a try and post back my results (will be later this evening)

-Richard

richardgunderse
Champ in-the-making
Champ in-the-making
Hi again

Still having problems I'm afraid. I defined my properties as d:content as shown below

            <property name="ix:DocImageBase64">
               <type>d:content</type>
               <mandatory>false</mandatory>
            </property>               
            <property name="ix:DocImage">
               <type>d:content</type>
               <mandatory>false</mandatory>
            </property>

Both properties have problems though, when the value is huge (over 100,000 chars).
I tried this with a fresh installation and a clean MySQL database (HSQL doesn't seem to have the same problem).

This is the exception reported by Alfresco (after upping the Hibernate logging)

00:24:00,849 ERROR [hibernate.util.JDBCExceptionReporter] Data truncation: Data truncated for column 'serializable_value' at row 1
00:24:00,849 ERROR [event.def.AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.DataException: Could not execute JDBC batch update
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)

Does Alfresco support arbitrary-length data types? Any help would be great!

Thanks

richardgunderse
Champ in-the-making
Champ in-the-making
Anyone, please?

archana_bonkanp
Champ in-the-making
Champ in-the-making
how to implement drop down list with static values