jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timur Evdokimov" <ti...@jacum.com>
Subject Limit of 65535 bytes per String value?
Date Wed, 16 Feb 2005 20:04:03 GMT

Hello everyone,

I just have been hit by a strange limitation of Jackrabbit
ObjectPersistenceManager.

I've got a custom property with String type and multiple="true" (which is
mapped to String[] Java type) 
The problem is that Jackrabbit writes these Strings internally using
DataOutputStream.writeUTF method, which throws UTFDataFormatException when
the number of bytes required to save that string is effectively more than
2^16, thus 65535

That leaves me to worry, because I thought I could have used these String[]
fields for multi-page articles and online books on my site. The only option
I've left to is use of multiple Binary field which could store fields any
length. However APIs for Binary fields works with InputStream! 

Because of this, my neat and nice 

setProperty("text", new String[] {xxx, yyy, ...}); 

would suddenly explode into full-blown method or even class of its own!

Were there any REAL reasons to limit Strings length by 65535? 
JCR spec, at a first quick sweep through, says nothing about it.

So I've made some quick changes to ObjectPersistenceManager, replacing
read/writeUTF with byte-wise String persistence, and it works for me.
Attached comes the copy.

Regards,
Timur

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message