Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED1C1D3B9 for ; Fri, 24 May 2013 05:39:24 +0000 (UTC) Received: (qmail 72782 invoked by uid 500); 24 May 2013 05:39:22 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 72368 invoked by uid 500); 24 May 2013 05:39:22 -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 71003 invoked by uid 99); 24 May 2013 05:39:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 05:39:20 +0000 Date: Fri, 24 May 2013 05:39:20 +0000 (UTC) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6214) PreparedStatement.setObject(int, Object, Types.CLOB) fail with DerbyNet MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666010#comment-13666010 ] Mamta A. Satoor commented on DERBY-6214: ---------------------------------------- Little more info on the exception raised by client server test cases. The exception is thrown by the server side code in org.apache.derby.iapi.types.ReaderToUTF8Stream:read(byte b[], int off, int len). The exception thrown is ('Stream has already been read and end-of-file reached and cannot be re-used.: java.io.EOFException'.) Part of org.apache.derby.iapi.types.ReaderToUTF8Stream:read is copied below for reference public int read(byte b[], int off, int len) throws IOException { // when stream has been read and eof reached, stream is closed // and buffer is set to null ( see close() method) // since stream cannot be re-used, check if stream is closed and // if so throw an EOFException if ( buffer == null ) throw new EOFException(MessageService.getTextMessage (SQLState.STREAM_EOF)); > PreparedStatement.setObject(int, Object, Types.CLOB) fail with DerbyNet > ----------------------------------------------------------------------- > > Key: DERBY-6214 > URL: https://issues.apache.org/jira/browse/DERBY-6214 > Project: Derby > Issue Type: Bug > Affects Versions: 10.8.3.0, 10.9.1.0 > Reporter: Rong Qu > Assignee: Mamta A. Satoor > Attachments: Derby6214.java, Derby6214_setup.sql, Derby6214_ver2.java, derby.log, DerbyNet_client_test.sql > > > The issue is specific to the DerbyNet client driver, and doesn't seem to occur using embedded Derby. > "PreparedStatement.setObject(int, Object, Types.CLOB)". It seems to be a problem updating a CLOB column with a parameterized value using the DerbyNet client driver, and if the update SQL ends up updating more than one row. I attached a simple test case that just uses JDBC to reproduce the error. The exception looks like this: > org.apache.derby.client.am.BatchUpdateException: Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements. > at org.apache.derby.client.am.Agent.endBatchedReadChain(Unknown Source) > at org.apache.derby.client.am.PreparedStatement.executeBatchRequestX(Unknown Source) > at org.apache.derby.client.am.PreparedStatement.executeBatchX(Unknown Source) > at org.apache.derby.client.am.PreparedStatement.executeBatch(Unknown Source) > ... > Caused by: org.apache.derby.client.am.SqlException: Error for batch element #0: An unexpected exception was thrown > at org.apache.derby.client.am.Statement.completeExecute(Unknown Source) > at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown Source) > at org.apache.derby.client.net.NetStatementReply.readExecute(Unknown Source) > at org.apache.derby.client.net.StatementReply.readExecute(Unknown Source) > at org.apache.derby.client.net.NetPreparedStatement.readExecute_(Unknown Source) > at org.apache.derby.client.am.PreparedStatement.readExecute(Unknown Source) > ... 4 more > Caused by: org.apache.derby.client.am.SqlException: Error for batch element #0: Java exception: 'Stream has already been read and end-of-file reached and cannot be re-used.: java.io.EOFException'. > at org.apache.derby.client.am.SqlException.(Unknown Source) > at org.apache.derby.client.am.SqlException.(Unknown Source) > ... 10 more -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira