Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 48699 invoked from network); 22 Jul 2009 13:39:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jul 2009 13:39:31 -0000 Received: (qmail 97260 invoked by uid 500); 22 Jul 2009 13:28:24 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 97247 invoked by uid 500); 22 Jul 2009 13:28:24 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 97238 invoked by uid 99); 22 Jul 2009 13:28:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jul 2009 13:28:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jul 2009 13:28:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 81DA8238887A; Wed, 22 Jul 2009 13:28:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r796712 - in /db/derby/code/branches/10.4/java: client/org/apache/derby/client/am/Lob.java testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java Date: Wed, 22 Jul 2009 13:28:01 -0000 To: derby-commits@db.apache.org From: kmarsden@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090722132801.81DA8238887A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kmarsden Date: Wed Jul 22 13:28:01 2009 New Revision: 796712 URL: http://svn.apache.org/viewvc?rev=796712&view=rev Log: DERBY-4312 SQLException XJ215 on insert with setCharacterStream() and autocommit off in mailjdbc test DERBY-4224 Commit after setAsciiStream() makes execution fail with the client driver Use of a stream after performing commit was incorrectly causing an exception. Also fixes setBinaryStream(); merge revision 796020 from trunk. Did not merge StreamingColumnTest changes since that test has not been converted in 10.4 Modified: db/derby/code/branches/10.4/java/client/org/apache/derby/client/am/Lob.java db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java Modified: db/derby/code/branches/10.4/java/client/org/apache/derby/client/am/Lob.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/client/org/apache/derby/client/am/Lob.java?rev=796712&r1=796711&r2=796712&view=diff ============================================================================== --- db/derby/code/branches/10.4/java/client/org/apache/derby/client/am/Lob.java (original) +++ db/derby/code/branches/10.4/java/client/org/apache/derby/client/am/Lob.java Wed Jul 22 13:28:01 2009 @@ -404,7 +404,8 @@ throw se.getSQLException(); } - if(!isValid_ || transactionID_ != agent_.connection_.getTransactionID()) + if(!isValid_ || (isLocator() && + (transactionID_ != agent_.connection_.getTransactionID()))) throw new SqlException(null,new ClientMessageId(SQLState.LOB_OBJECT_INVALID)) .getSQLException(); } Modified: db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java?rev=796712&r1=796711&r2=796712&view=diff ============================================================================== --- db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java (original) +++ db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java Wed Jul 22 13:28:01 2009 @@ -111,6 +111,8 @@ PreparedStatement ps = prepareStatement( sql); ps.setBinaryStream( 1, is,data.length); + //DERBY-4312 Make sure commit() doesn't interfere here + commit(); ps.executeUpdate(); // Make sure things still work ok when we have a parameter that does get consumed. // insert a matching row. @@ -208,6 +210,8 @@ Reader streamReader = new LoopingAlphabetReader( clobLength, CharAlphabet.tamil()); ps.setCharacterStream(1, streamReader, clobLength); + //DERBY-4312 make sure commit() doesn't interfere + commit(); ps.executeUpdate(); streamReader.close(); ps.close(); @@ -1301,6 +1305,8 @@ InputStream streamIn = new LoopingAlphabetStream(10000); ps.setAsciiStream(5, streamIn, 10000); ps.setInt(6, 1); + // DERBY-4312 make sure commit() doesn't interfere here. + commit(); ps.executeUpdate(); streamIn.close(); ps.close();