[CDO] Issues with uploading CLobs in non 1-byte encoding [message #1389157] |
Fri, 27 June 2014 12:15 |
Leonid Ripeynih Messages: 150 Registered: February 2012 |
Senior Member |
|
|
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 08:45 |
Esteban Dugueperoux Messages: 472 Registered: July 2009 |
Senior Member |
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03688 seconds