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

espinha edited comment on DERBY-3574 at 4/8/08 11:20 AM:
------------------------------------------------------------------

I have attached Knut's implementation with a twist. I did use an integer as a 
counter, as apparently the UUID class is only for Java 1.5+ and the integer is 
just as good.

Anyway, the twist is:
Instead of doing the check on checkValidity(), I added the transactionID_ to 
the Lob class. This is better since we want the same check for all kinds of 
Lobs. Since Lob doesn't have a checkValidity(), I've added the check to the 
sqlLength() method and I throw an exception there.

The Connection.java also has a transactionID_ now, which is the "index" of the 
current transaction. It's private and it should never be altered, except for 
the increment done on the commit() method.

Needs to be added that with this solution,TestLobLength does pass.

      was (Author: espinha):
    I have attached Knut's implementation with a twist. I did use an integer as 
a counter, as apparently the UUID class is only for Java 1.5+ and the integer 
is just as good.

Anyway, the twist is:
Instead of doing the check on checkValidity(), I added the transactionID_ to 
the Lob class. This is better since we want the same check for all kinds of 
Lobs. Since Lob doesn't have a checkValidity(), I've added the check to the 
sqlLength() method and I throw an exception there.

The Connection.java also has a transactionID_ now, which is the "index" of the 
current transaction. It's private and it should never be altered, except for 
the increment done on the commit() method.
  
> 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-connection-java.patch, 
> derby3574-lob-java.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