[ 
https://issues.apache.org/jira/browse/DERBY-4005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662369#action_12662369
 ] 

Kristian Waagan commented on DERBY-4005:
----------------------------------------

Note: Remember to change the master file for largedata/LobLimits.java if the 
error message for truncation failure is changed.

> Make DerbyIOException useful for error messages requiring arguments to be 
> constructed
> -------------------------------------------------------------------------------------
>
>                 Key: DERBY-4005
>                 URL: https://issues.apache.org/jira/browse/DERBY-4005
>             Project: Derby
>          Issue Type: Improvement
>          Components: Store
>    Affects Versions: 10.5.0.0
>            Reporter: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-4005-option_b_preview.diff
>
>
> DerbyIOException is a subclass of IOException used to separate between 
> "genuine" IOExceptions and exceptions generated by Derby in environments 
> where only an IOException is allowed to be thrown.
> Currently, the exception class carries an SQLState. If Derby catches 
> DerbyIOException before IOException, it can generate a SQLException with the 
> correct SQLState and throw it. The DerbyIOException must be attached to avoid 
> loosing the original stack trace.
> The problem arising with SQLExceptions requiring arguments for the message 
> construction, is that the arguments are not available when the SQLException 
> is constructed.
> There are at least two solutions to this problem:
>  a) Save the arguments in the DerbyIOException
>  b) Save an SQLException in the DerbyIOException
> The motivation for fixing this issue, is that the user sees different 
> exceptions for the same root cause depending on which method is used to 
> insert a string data value. In general the differences are between stream and 
> non-stream methods, for instance PreparedStatement.setString and 
> PreparedStatement.setCharacterStream.
> For instance, the non-stream method will throw 22001 (data truncation), but 
> the stream method will throw XJ001 (java exception).

-- 
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