db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2992) getBinaryStream returns incorrect result (truncated value) if underlying blob is deleted
Date Thu, 04 Feb 2010 20:21:29 GMT

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

Kristian Waagan commented on DERBY-2992:
----------------------------------------

>From a small experiment running the attached repro, where I made OverflowInputStream throw
an exception if it detects that the specified overflow page cannot be found, the following
lock dumps shows that an extra lock is set when using the client driver:

** Embedded:
/---- Lock dump 1
477 | TABLE | IS | BLOBTAB | Tablelock | GRANT | T | 1 | null | 
      Lock dump 1 -----/
Caught IOException:EOF reached prematurely
0 rows in BLOBCLOB

** Client:
/---- Lock dump 1
368 | TABLE | IS | BLOBTAB | Tablelock | GRANT | T | 2 | null | 
368 | ROW | S | BLOBTAB | (2,6) | GRANT | T | 1 | null | 
      Lock dump 1 -----/
// Results in lock timeout.

Haven't investigated further, but the repro code is identical except for the connection URL
so there is definitely a difference between embedded and client/server.
Also, are there any valid situations where OverflowInputStream.fillByteHolder should fail
to get the overflow page when an overflow page has been specified?
(the next overflow page is set by a callback, according to the comments)

Finally, if the suggested fix is pursued, we might want to beef up the error message. Any
suggestions?

> getBinaryStream returns incorrect result (truncated value) if underlying blob is deleted
> ----------------------------------------------------------------------------------------
>
>                 Key: DERBY-2992
>                 URL: https://issues.apache.org/jira/browse/DERBY-2992
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.2.2.0, 10.3.1.4, 10.4.1.3
>            Reporter: Kathey Marsden
>         Attachments: TruncatedBlob.java
>
>
> If getBinaryStream is reading a value (READ_UNCOMMITTED) and the row is deleted by another
connection, a truncated value will be returned without error. I believe instead either the
whole value or an IOException should occur.
> With 10.2 and higher with the repro attahed we get:
> > java TruncatedBlob
> Embedded:
> Read 32669 bytes
> 0 rows in BLOBCLOB
> With 10.1
> Embedded:
> Read 40000 bytes (OK)
> 0 rows in BLOBCLOB 
> Note network server returns the full value for both 10.1 and 10.2 but gives a lock timeout
for 10.2+.  I will file a separate issue for that.

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


Mime
View raw message