Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
Using streams as input for JDBC methods.
-
Normal
-
Embedded/Client difference
Description
The way streaming errors are reported differ between the client driver and the embedded driver.
The following SQLStates can be seen:
XCL30.S=An IOException was thrown when reading a ''
XSDA4.S=An unexpected exception was thrown
22001=A truncation error was encountered trying to shrink {0}
''
{1}'' to length {2}.XJ023.S=Input stream did not have exact amount of data as the requested length.
XN014.S=Network protocol error: encountered an IOException, parameter #{0}. Remaining data has been padded with 0x0. Message: {1}
.
XN015.S=Network protocol error: the specified size of the InputStream, parameter #
XN016.S=Network protocol error: encountered error in stream length verification, parameter #{0}
. Message:
{1}.
XN017.S=Network protocol error: end of stream prematurely reached, parameter #
XN018.S=Network protocol error: the specified size of the Reader, parameter #{0}
, is less than the actual InputStream length.
Some of these exceptions are nested inside one or more of the other exceptions.
There are basicly three types of streaming errors:
a) The stream is too long for the column it is being inserted into
b) The actual length of the stream does not match the specified length
c) A general IOException is thrown when reading from the stream
An approach would be to always throw specific exceptions for a) and b), for instance 22001 and XJ023, and throw a general exception for class c) exceptions (the message of the IOException would be wrapped/included).
Note that the level of detail in client and embedded (in the top level exception) might vary; it can be XN017 on the client, but XSDA4 in embedded (for the same JDBC code causing the exception).
Changing the SQLStates might impact existing applications, but aligning the drivers' behavior has high priority.
Attachments
Issue Links
- is part of
-
DERBY-310 Document and/or change Derby client code to match behavior with Embedded driver where possible.
- Closed
- is related to
-
DERBY-1473 Add cut-off and truncation logic to streaming classes in the embedded driver
- Closed