db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
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 GMT
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();



Mime
View raw message