Skip to main content



      Home
Home » Modeling » EMF » [CDO] Issues with uploading CLobs in non 1-byte encoding
[CDO] Issues with uploading CLobs in non 1-byte encoding [message #1389157] Fri, 27 June 2014 08:15 Go to next message
Eclipse UserFriend
Hi!

I've discovered a problem in CDO Clob handling:

here is the code, which is located in org.eclipse.emf.cdo.spi.server.StoreAccessor:

writeClob(id, -size, new InputStreamReader(new LimitedInputStream(in, -size)));


Next, in org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeClob(byte[], long, Reader)

stmt.setCharacterStream(3, reader, (int)size);


Code in StoreAccessor implies, that the amount of chars (passed to setCharactedStream) is equal to number of bytes passed to LimitedInputStream.

That leads to commit exceptions, whenever text in non-ascii encoding is submited.
Also, i've noticed that there is no encoding passed to InputStreamReader constructor, which means that encoding is platform-dependant, which can easily lead to more issues in future.
Re: [CDO] Issues with uploading CLobs in non 1-byte encoding [message #1390969 is a reply to message #1389157] Mon, 30 June 2014 04:45 Go to previous message
Eclipse UserFriend
Hi Leonid,

Could you raise a bugzilla with a Gerrit patch-set containing a JUnit
test to reproduce your issues.

Best Regards.

Le 27/06/2014 14:15, Leonid Ripeynih a écrit :
> Hi!
>
> I've discovered a problem in CDO Clob handling:
>
> here is the code, which is located in
> org.eclipse.emf.cdo.spi.server.StoreAccessor:
>
>
> writeClob(id, -size, new InputStreamReader(new LimitedInputStream(in,
> -size)));
>
>
> Next, in
> org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeClob(byte[],
> long, Reader)
>
>
> stmt.setCharacterStream(3, reader, (int)size);
>
>
> Code in StoreAccessor implies, that the amount of chars (passed to
> setCharactedStream) is equal to number of bytes passed to
> LimitedInputStream.
>
> That leads to commit exceptions, whenever text in non-ascii encoding is
> submited. Also, i've noticed that there is no encoding passed to
> InputStreamReader constructor, which means that encoding is
> platform-dependant, which can easily lead to more issues in future.
Previous Topic:[CDO] CDOServerExporter Out of memory exception
Next Topic:Xcore and FeatureMaps
Goto Forum:
  


Current Time: Sat Jul 05 21:33:27 EDT 2025

Powered by FUDForum. Page generated in 0.02575 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top