You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2008/07/17 10:49:31 UTC

[jira] Created: (DERBY-3783) LOBStreamControl shoudn't throw SQLException

LOBStreamControl shoudn't throw SQLException
--------------------------------------------

                 Key: DERBY-3783
                 URL: https://issues.apache.org/jira/browse/DERBY-3783
             Project: Derby
          Issue Type: Improvement
          Components: JDBC
    Affects Versions: 10.4.1.4, 10.5.0.0
            Reporter: Kristian Waagan
            Assignee: Kristian Waagan
            Priority: Minor


LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
All the SQLException are generated/thrown from the code in LOBStreamControl.
At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.


I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Resolved: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen resolved DERBY-3783.
---------------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

Committed d3783-initCause.diff with revision 678388.

> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.1.4, 10.5.0.0
>
>         Attachments: d3783-initCause.diff, derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Commented: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614678#action_12614678 ] 

Knut Anders Hatlen commented on DERBY-3783:
-------------------------------------------

One small suggestion, while you're at it:

LOBInputStream.java:
+            } else {
+                throw new IOException(se.getMessage());
+            }

To preserve the stack trace: throw (IOException) new IOException(se.getMessage()).initCause(se);

Perhaps we should have a helper method for this, since we seem to need it multiple places in these classes.

> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Closed: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan closed DERBY-3783.
----------------------------------


> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.2.0, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: d3783-initCause.diff, derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Commented: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619959#action_12619959 ] 

Kristian Waagan commented on DERBY-3783:
----------------------------------------

Backported 'd3783-initCause.diff' to 10.4 with revision 682803. It went in with the patches for DERBY-3766.

> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.2.0, 10.5.0.0
>
>         Attachments: d3783-initCause.diff, derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Updated: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-3783:
--------------------------------------

    Attachment: d3783-initCause.diff

I have created a patch which adds a method newIOException(Throwable cause) to the Util class in impl.jdbc and changes all occurrences of new IOException(e.getMessages()) in that package to use the utility method. All tests in derbyall and suites.All passed with the patch.

> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.1.4, 10.5.0.0
>
>         Attachments: d3783-initCause.diff, derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Updated: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-3783:
-----------------------------------

       Derby Info:   (was: [Patch Available])
    Fix Version/s: 10.5.0.0
                   10.4.1.4

That's a good idea Knut Anders!
Preserving the stack traces is important.

I forgot to add a comment that I committed patch 'derby-3783-1a-dont_throw_sqlexception.diff' yesterday:
 - trunk : revision 677623
 - 10.4 : revision 677628

I'm leaving the issue open for now.

> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.1.4, 10.5.0.0
>
>         Attachments: derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Updated: (DERBY-3783) LOBStreamControl shoudn't throw SQLException

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-3783:
-----------------------------------

    Attachment: derby-3783-1a-dont_throw_sqlexception.stat
                derby-3783-1a-dont_throw_sqlexception.diff

'derby-3783-1a-dont_throw_sqlexception.diff' makes LOBStreamControl throw StandardException instead of SQLException.
I've tried to change as little as possible, but there was logic in some of the catch blocks that had to be moved.

I've run jdbcapi._Suite without failures, running suites.All and derbyall now.
I plan to commit (or post a new patch) once the tests have completed. Patch ready for review.

> LOBStreamControl shoudn't throw SQLException
> --------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Commented: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615107#action_12615107 ] 

Kristian Waagan commented on DERBY-3783:
----------------------------------------

+1 to commit ' d3783-initCause.diff'.

> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.1.4, 10.5.0.0
>
>         Attachments: d3783-initCause.diff, derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Updated: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-3783:
--------------------------------------

    Derby Info: [Patch Available]

> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.1.4, 10.5.0.0
>
>         Attachments: d3783-initCause.diff, derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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


[jira] Updated: (DERBY-3783) LOBStreamControl shouldn't throw SQLException

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-3783:
-----------------------------------

    Summary: LOBStreamControl shouldn't throw SQLException  (was: LOBStreamControl shoudn't throw SQLException)

> LOBStreamControl shouldn't throw SQLException
> ---------------------------------------------
>
>                 Key: DERBY-3783
>                 URL: https://issues.apache.org/jira/browse/DERBY-3783
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.4.1.4, 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>         Attachments: derby-3783-1a-dont_throw_sqlexception.diff, derby-3783-1a-dont_throw_sqlexception.stat
>
>
> LOBStreamControl throws three types of exceptions: IOException, SQLException and StandardException.
> All the SQLException are generated/thrown from the code in LOBStreamControl.
> At this level of the code, SQLException should not be thrown, as it is more tedious to handle both SQLException and StandardException at higher levels.
> I propose to replace SQLException with StandardException in LOBStreamControl. The purpose of this change is consistency, and also results it slightly less code at higher levels.

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