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

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

Do we really need this extra check in checkValidity()?

+       /**
+        * If there isn't an open connection, the Lob is invalid.
+        */
+       try{
+               agent_.connection_.checkForClosedConnection();
+       }catch(SqlException se){
+               throw se.getSQLException();
+       }

If I am not mistaken, closing the connection is only allowed if there is no 
active transaction on the connection, which means that Connection.transactionID 
!= Lob.transactionID so that checkValidity() will throw an exception anyway.

> With client, attempting to get the lob length after commit  or connection 
> close if there  was a call to length() before commit does not throw an 
> exception
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3574
>                 URL: https://issues.apache.org/jira/browse/DERBY-3574
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client, Newcomer
>    Affects Versions: 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Tiago R. Espinha
>            Priority: Trivial
>         Attachments: derby3574-testfix.patch, derby3574-testfix.patch, 
> derby3574-wtest.patch, derby3574.patch, TestLobLength.java
>
>
> Attempting to get call Blob/Clob.length() after commit or connection close 
> does not fail if there was a previous call to length().  If no previous call 
> was made an exception is thrown as expected.
> See attached program TestLobLength for repro with commit.  If you comment out 
> the two lines to get the length before the commit we get the expected 
> 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