[ 
https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700149#action_12700149
 ] 

Kristian Waagan commented on DERBY-4102:
----------------------------------------

I'm seeing an intermittent failure when running with the patch. The failure 
happens in jdbcapi.LobStreamsTest.
I have seen the following two stack traces:

1) 
testBlobWrite3Param(org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest)java.io.IOException:
 ERROR 40XD0: Container has been closed.
        at 
org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:159)
        at 
org.apache.derby.impl.store.raw.data.BufferedByteHolderInputStream.read(BufferedByteHolderInputStream.java:44)
        at java.io.DataInputStream.read(DataInputStream.java:132)
        at 
org.apache.derby.impl.jdbc.PositionedStoreStream.read(PositionedStoreStream.java:116)
        at 
org.apache.derby.impl.jdbc.AutoPositioningStream.read(AutoPositioningStream.java:113)
        at 
org.apache.derby.impl.jdbc.UpdatableBlobStream.read(UpdatableBlobStream.java:184)
        at 
org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest.readBytesFromStream(LobStreamsTest.java:463)
        at 
org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest.compareLob2File(LobStreamsTest.java:488)
        at 
org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest.testBlobWrite3Param(LobStreamsTest.java:130)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at 
org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:105)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at 
org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at 
org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)

FAILURES!!!
Tests run: 24,  Failures: 0,  Errors: 1

1) 
testBlobWrite3Param(org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest)java.sql.SQLException:
 The data in this BLOB or CLOB is no longer available.  The BLOB/CLOB's 
transaction may be committed, its connection closed or it has been freed.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:201)
        at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:391)
        at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
        at 
org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201)
        at 
org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
        at 
org.apache.derby.impl.jdbc.EmbedBlob.handleMyExceptions(EmbedBlob.java:792)
        at 
org.apache.derby.impl.jdbc.EmbedBlob.getBinaryStream(EmbedBlob.java:549)
        at 
org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest.testBlobWrite3Param(LobStreamsTest.java:129)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at 
org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:105)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at 
org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
Caused by: java.sql.SQLException: The data in this BLOB or CLOB is no longer 
available.  The BLOB/CLOB's transaction may be committed, its connection closed 
or it has been freed.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
        ... 39 more
Caused by: ERROR XJ073: The data in this BLOB or CLOB is no longer available.  
The BLOB/CLOB's transaction may be committed, its connection closed or it has 
been freed.
        at 
org.apache.derby.iapi.error.StandardException.newException(StandardException.java:276)
        at 
org.apache.derby.impl.jdbc.EmbedBlob.handleMyExceptions(EmbedBlob.java:789)
        ... 33 more


On my system the problem is seen in maybe one out of ten or fifteen runs. I 
can't see  the new code being run as part of the test, so I'm not sure what's 
going on here.

> Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K
> -----------------------------------------------------------------------------
>
>                 Key: DERBY-4102
>                 URL: https://issues.apache.org/jira/browse/DERBY-4102
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.1.1.0, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.0.0, 
> 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>         Attachments: CastExc.java, derby-4102-1a.diff, derby-4102-1a.stat
>
>
> The code below results in an assert error (with sane jars) or a 
> ClassCastException (with insane jars):
>         PreparedStatement ps = c.prepareStatement("values cast(? as blob)");
>         int len = 32 * 1024;
>         ps.setBinaryStream(1, new ByteArrayInputStream(new byte[len]), len);
>         ResultSet rs = ps.executeQuery();
>         while (rs.next()) {
>             rs.getBlob(1);
>         }
> If len < 32K there is no error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to