Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 85832 invoked from network); 4 Jun 2007 11:29:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jun 2007 11:29:57 -0000 Received: (qmail 36472 invoked by uid 500); 4 Jun 2007 11:30:01 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 36431 invoked by uid 500); 4 Jun 2007 11:30:01 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 36422 invoked by uid 99); 4 Jun 2007 11:30:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2007 04:30:00 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2007 04:29:56 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 486B571418F for ; Mon, 4 Jun 2007 04:29:36 -0700 (PDT) Message-ID: <15042469.1180956576293.JavaMail.jira@brutus> Date: Mon, 4 Jun 2007 04:29:36 -0700 (PDT) From: "V.Narayanan (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-2017) Client driver can insert and commit partial data when a LOB stream throws IOException or does not match the specified length In-Reply-To: <18308033.1162198636492.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-2017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501179 ] V.Narayanan commented on DERBY-2017: ------------------------------------ Some thoughts on this issue. The solution for this is difficult because of the following reason The idea of not causing an OutOfMemory error in the client is that you should transmit the data without materializing it. But how would you get the length then? This would be necessary to throw the stream truncation exception that is thrown. I somehow feel that the trick of not writing this data should lie in the server and the client rather than in the client alone. a) The server should keep with it the data it gets from the stream sent as chunks without writing it into the database. b) When the client reaches the end of the stream it comes to know that the truncation has happened it would inform the server that truncation has happened and the server does not write the data. The above outlined steps would be possible if the PreparedStatement were converted to use locators. So when a setBinaryStream is called a) create a locator value b) write the stream to the locator value(using CLOBSETSTRING or BLOBSETBYTES) c) If truncation happens Call CLOBRELEASELOCATOR and release this value. Note: here we have not gone to the PreparedStatement execute as yet. d) If there is not truncation do what happens in locators attach the stream to the PreparedStatement as happens for locators now. Drawbacks --------- 1) This implementation would mean not using Layer-B streaming for Prepared Statements. Layer-B streaming is a better way to transmit this stream data than locators which was the reason that during locator work the decision was taken to retain Layer-B implementation here. See Derby-2529. 2) Locators involve building a temporary LOB on the server. This would again make it less efficient than Layer-B streaming. > Client driver can insert and commit partial data when a LOB stream throws IOException or does not match the specified length > ---------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-2017 > URL: https://issues.apache.org/jira/browse/DERBY-2017 > Project: Derby > Issue Type: Bug > Components: JDBC, Network Client > Affects Versions: 10.2.1.6 > Reporter: Knut Anders Hatlen > Assignee: Mayuresh Nirhali > Attachments: derby2017_try1.diff, Derby_2017_v1.diff, Derby_2017_v1.stat, StreamErrRepro.java > > > When a LOB stream throws an exception or does not match the specified length, the client driver does not raise an exception until it has finished executing the statement. Therefore, the statement will be executed (and possibly committed) on the server even though the client reports that the statement failed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.