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 "V.Narayanan (JIRA)" <de...@db.apache.org> on 2006/06/16 16:48:30 UTC
[jira] Created: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
----------------------------------------------------------------------------------
Key: DERBY-1421
URL: http://issues.apache.org/jira/browse/DERBY-1421
Project: Derby
Type: Bug
Components: JDBC
Reporter: V.Narayanan
Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
Posted by "Andreas Korneliussen (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-1421?page=all ]
Andreas Korneliussen resolved DERBY-1421:
-----------------------------------------
Fix Version: 10.2.0.0
Resolution: Fixed
Derby Info: (was: [Patch Available])
Committed revision 418221.
> ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
> ----------------------------------------------------------------------------------
>
> Key: DERBY-1421
> URL: http://issues.apache.org/jira/browse/DERBY-1421
> Project: Derby
> Type: Bug
> Components: JDBC
> Versions: 10.2.0.0
> Reporter: V.Narayanan
> Assignee: Fernanda Pizzorno
> Fix For: 10.2.0.0
> Attachments: TestUpdateBinaryStream.java, derby-1421.diff, derby-1421.stat, derby-1421v2.diff
>
> Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
Posted by "Fernanda Pizzorno (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-1421?page=all ]
Fernanda Pizzorno updated DERBY-1421:
-------------------------------------
Version: 10.2.0.0
Derby Info: [Patch Available]
> ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
> ----------------------------------------------------------------------------------
>
> Key: DERBY-1421
> URL: http://issues.apache.org/jira/browse/DERBY-1421
> Project: Derby
> Type: Bug
> Components: JDBC
> Versions: 10.2.0.0
> Reporter: V.Narayanan
> Assignee: Fernanda Pizzorno
> Attachments: TestUpdateBinaryStream.java, derby-1421.diff, derby-1421.stat
>
> Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
Posted by "Andreas Korneliussen (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-1421?page=comments#action_12417988 ]
Andreas Korneliussen commented on DERBY-1421:
---------------------------------------------
The patch looks good, however I have one issue which should be discussed/clarified:
The patch makes use of an impl class (import org.apache.derby.impl.store.raw.data.RememberBytesInputStream) . I have not seen any other classes in the package org.apache.derby.iapi.types, make use of impl classes, so I am not sure if it breaks some design-rule in derby. In this case, it could probably be ok, since we are not exposing the impl class to the client, only using it in the implementation of a class.
Another question is if we could avoid the cloning of the column somehow or if it is possible to use a shallow clone? As far as I can tell, the current cloning will do an inmemory copy of all data in the blob column, and if it is a 1GB blob, I think it will cause an OutOfMemory error.
> ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
> ----------------------------------------------------------------------------------
>
> Key: DERBY-1421
> URL: http://issues.apache.org/jira/browse/DERBY-1421
> Project: Derby
> Type: Bug
> Components: JDBC
> Versions: 10.2.0.0
> Reporter: V.Narayanan
> Assignee: Fernanda Pizzorno
> Attachments: TestUpdateBinaryStream.java, derby-1421.diff, derby-1421.stat
>
> Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
Posted by "Fernanda Pizzorno (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-1421?page=comments#action_12418591 ]
Fernanda Pizzorno commented on DERBY-1421:
------------------------------------------
The patch derby-1421v2.diff looks good. Since cloning is removed in DERBY-802, changes to SQLBinary in derby-1421.diff would not be necessary.
> ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
> ----------------------------------------------------------------------------------
>
> Key: DERBY-1421
> URL: http://issues.apache.org/jira/browse/DERBY-1421
> Project: Derby
> Type: Bug
> Components: JDBC
> Versions: 10.2.0.0
> Reporter: V.Narayanan
> Assignee: Fernanda Pizzorno
> Attachments: TestUpdateBinaryStream.java, derby-1421.diff, derby-1421.stat, derby-1421v2.diff
>
> Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Assigned: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
Posted by "Fernanda Pizzorno (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-1421?page=all ]
Fernanda Pizzorno reassigned DERBY-1421:
----------------------------------------
Assign To: Fernanda Pizzorno
> ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
> ----------------------------------------------------------------------------------
>
> Key: DERBY-1421
> URL: http://issues.apache.org/jira/browse/DERBY-1421
> Project: Derby
> Type: Bug
> Components: JDBC
> Reporter: V.Narayanan
> Assignee: Fernanda Pizzorno
> Attachments: TestUpdateBinaryStream.java
>
> Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
Posted by "Fernanda Pizzorno (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-1421?page=all ]
Fernanda Pizzorno updated DERBY-1421:
-------------------------------------
Attachment: derby-1421.diff
derby-1421.stat
ResultSet.updateBinaryStream() fails for scrollable updatable result sets because of a call to the method ExecRow.clone() that fails. When the clone method in the SQLBinary column is called, the stream has already been read and is closed, and an attempt to read this closed stream causes an exception. The streams used in this case are of type RemeberBytesInputStream. This type of stream keeps a copy of every byte that has been read or skipped, and can be re-read using a "replay" stream.
This patch (derby-1421.diff) fixes this problem by using the "replay" stream to get the data, if the stream has previously been read. I have successfully run derbyall with this patch. Can someone please review it?
Thank you in advance.
> ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
> ----------------------------------------------------------------------------------
>
> Key: DERBY-1421
> URL: http://issues.apache.org/jira/browse/DERBY-1421
> Project: Derby
> Type: Bug
> Components: JDBC
> Reporter: V.Narayanan
> Assignee: Fernanda Pizzorno
> Attachments: TestUpdateBinaryStream.java, derby-1421.diff, derby-1421.stat
>
> Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
Posted by "V.Narayanan (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-1421?page=all ]
V.Narayanan updated DERBY-1421:
-------------------------------
Attachment: TestUpdateBinaryStream.java
The above program fails with the following message
Exception in thread "main" org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED statementContext is not expected to equal statementContexts[0]
at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:119)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.popStatementContext(GenericLanguageConnectionContext.java:2027)
at org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3577)
at TestUpdateBinaryStream.main(TestUpdateBinaryStream.java:43)
Java Result: 1
> ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
> ----------------------------------------------------------------------------------
>
> Key: DERBY-1421
> URL: http://issues.apache.org/jira/browse/DERBY-1421
> Project: Derby
> Type: Bug
> Components: JDBC
> Reporter: V.Narayanan
> Attachments: TestUpdateBinaryStream.java
>
> Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DERBY-1421) ResultSet.updateBinaryStream fails
when the result type is TYPE_SCROLL_INSENSITIVE
Posted by "Andreas Korneliussen (JIRA)" <de...@db.apache.org>.
[ http://issues.apache.org/jira/browse/DERBY-1421?page=all ]
Andreas Korneliussen updated DERBY-1421:
----------------------------------------
Attachment: derby-1421v2.diff
As part of fixing DERBY-802, I found that the call to rowChanger.updateRow(..) has destructive effect on the Blob columns, so that they cannot be used again in source.updateRow(..) when doing clone or if it is to be used for writing it into a disk hash table.
I have therefore replaced the order of the calls in UpdatableResultSet.java, so that they are now:
source.updateRow(newBaseRow);
rowChanger.updateRow(row,newBaseRow,baseRowLocation);
This means that the hashtable in ScrollInsensitiveResultSet will be updated before the actual row is updated, however from the user this is atomic.
With the patch derby-1421v2.diff, I have kept all the tests in derby-1421.diff, however I have removed the changes in SQLBinary. The test passes.
Using this patch, in combination with the removal of cloning in DERBY-802 I have been able to read and update 64MB blobs in scrollable insensitive result sets.
> ResultSet.updateBinaryStream fails when the result type is TYPE_SCROLL_INSENSITIVE
> ----------------------------------------------------------------------------------
>
> Key: DERBY-1421
> URL: http://issues.apache.org/jira/browse/DERBY-1421
> Project: Derby
> Type: Bug
> Components: JDBC
> Versions: 10.2.0.0
> Reporter: V.Narayanan
> Assignee: Fernanda Pizzorno
> Attachments: TestUpdateBinaryStream.java, derby-1421.diff, derby-1421.stat, derby-1421v2.diff
>
> Attaching test program for the above bug. The program however works fine when the ResultSetType is TYPE_FORWARD_ONLY.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira