[ 
https://issues.apache.org/jira/browse/DERBY-1657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kathey Marsden updated DERBY-1657:
----------------------------------

    Derby Categories: [Embedded/Client difference]

> Align error reporting in the client driver and embedded driver for streaming 
> errors through the JDBC API
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1657
>                 URL: https://issues.apache.org/jira/browse/DERBY-1657
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC, Network Client, Network Server, Store
>         Environment: Using streams as input for JDBC methods.
>            Reporter: Kristian Waagan
>
> 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 ''{0}'' from an InputStream.
> 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 #{0}, is less than the actual InputStream length.
> 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 
> #{0}.  Remaining data has been padded with 0x0.
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to