You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2009/03/19 12:53:50 UTC

[jira] Created: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

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.4.2.0, 10.3.3.0, 10.2.2.0, 10.1.1.0, 10.5.0.0, 10.6.0.0
            Reporter: Knut Anders Hatlen


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.


[jira] Updated: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-4102:
---------------------------------

    Urgency: Normal

Triaged July 2, 2009: Assigned normal urgency.

> 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.1.1, 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.


[jira] Closed: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen closed DERBY-4102.
-------------------------------------


Verified fix on trunk. Closing.

> 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.1.1, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>             Fix For: 10.4.2.1, 10.5.3.1, 10.6.0.0
>
>         Attachments: CastExc.java, derby-4102-1a.diff, derby-4102-1a.stat, java-deadlock.txt
>
>
> 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.


[jira] Updated: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-4102:
-----------------------------------

    Issue & fix info:   (was: [Patch Available])
       Fix Version/s: 10.6.0.0

Committed patch 1a to trunk with revision 835286. Will check if the fix can be back-ported.

> 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.1.1, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>             Fix For: 10.6.0.0
>
>         Attachments: CastExc.java, derby-4102-1a.diff, derby-4102-1a.stat, java-deadlock.txt
>
>
> 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.


[jira] Commented: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699761#action_12699761 ] 

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

Running the regression tests. If they all pass, I'll commit patch 1a tomorrow.

> 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.


[jira] Updated: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-4102:
-----------------------------------

    Attachment: java-deadlock.txt

The Java deadlock seen when running tests.jdbcapi.LobStreamsTest (dual core machine, 3.2 GHz).

> 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.1.1, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>         Attachments: CastExc.java, derby-4102-1a.diff, derby-4102-1a.stat, java-deadlock.txt
>
>
> 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.


[jira] Commented: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12775362#action_12775362 ] 

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

Testing this patch again, I have observed an intermittent failure both with a clean trunk and with a patched trunk (patch DERBY-4102 1a).

Running with a sane build:
1) testBlobWrite3Param(org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest)org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED
        at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:98)
        at org.apache.derby.impl.store.raw.data.BasePage.unlatch(BasePage.java:1365)
        at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:152)
        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:109)
        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)

This associated code in BasePage is:
	public void unlatch() {
		if (SanityManager.DEBUG) {
			SanityManager.ASSERT(isLatched());
		}
	   releaseExclusive();
	}


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:109)
        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)

The origin of the real exception is lost here (not chained), and when I was about to investigate where it 

The Java deadlock (see attached dump for details):

> 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.1.1, 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.


[jira] Issue Comment Edited: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12775362#action_12775362 ] 

Kristian Waagan edited comment on DERBY-4102 at 11/10/09 10:11 AM:
-------------------------------------------------------------------

Testing this patch again, I have observed an intermittent failure both with a clean trunk and with a patched trunk (patch DERBY-4102 1a).

Running with a sane build:
1) testBlobWrite3Param(org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest)org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED
        at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:98)
        at org.apache.derby.impl.store.raw.data.BasePage.unlatch(BasePage.java:1365)
        at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:152)
        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:109)
        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)

This associated code in BasePage is:
    public void unlatch() {
        if (SanityManager.DEBUG) {
            SanityManager.ASSERT(isLatched());
        }
        releaseExclusive();
    }


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:109)
        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)

The origin of the real exception is lost here (not chained), but investigation shows where it comes from:
	at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:276)
	at org.apache.derby.impl.store.raw.data.BaseContainerHandle.checkOpen(BaseContainerHandle.java:978)
	at org.apache.derby.impl.store.raw.data.BaseContainerHandle.getPage(BaseContainerHandle.java:317)
	at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:146)
	at org.apache.derby.impl.store.raw.data.BufferedByteHolderInputStream.read(BufferedByteHolderInputStream.java:44)
        ...

The Java deadlock (see attached dump for details):
Found one Java-level deadlock:
=============================
"Finalizer":
  waiting to lock monitor 0x080f2038 (object 0xceb8ef08, a org.apache.derby.impl.store.raw.data.StoredPage),
  which is held by "main"
"main":
  waiting to lock monitor 0x082b5ef8 (object 0xceb98fe8, a org.apache.derby.impl.store.raw.data.BaseContainerHandle),
  which is held by "Finalizer"


Since the problem occurs both with and without the patch, I plan to commit it.
I will log a new Jira for the deadlock and the asserts/exceptions. I assume they are all symptoms of the same problem, arising due to slightly different timing.

      was (Author: kristwaa):
    Testing this patch again, I have observed an intermittent failure both with a clean trunk and with a patched trunk (patch DERBY-4102 1a).

Running with a sane build:
1) testBlobWrite3Param(org.apache.derbyTesting.functionTests.tests.jdbcapi.LobStreamsTest)org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED
        at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:98)
        at org.apache.derby.impl.store.raw.data.BasePage.unlatch(BasePage.java:1365)
        at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(OverflowInputStream.java:152)
        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:109)
        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)

This associated code in BasePage is:
	public void unlatch() {
		if (SanityManager.DEBUG) {
			SanityManager.ASSERT(isLatched());
		}
	   releaseExclusive();
	}


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:109)
        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)

The origin of the real exception is lost here (not chained), and when I was about to investigate where it 

The Java deadlock (see attached dump for details):
  
> 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.1.1, 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.


[jira] Commented: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12775368#action_12775368 ] 

Knut Anders Hatlen commented on DERBY-4102:
-------------------------------------------

The intermittent failure in testBlobWrite3Param() is already logged as DERBY-3844.

> 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.1.1, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>         Attachments: CastExc.java, derby-4102-1a.diff, derby-4102-1a.stat, java-deadlock.txt
>
>
> 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.


[jira] Assigned: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan reassigned DERBY-4102:
--------------------------------------

    Assignee: Kristian Waagan

> 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.


[jira] Commented: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694069#action_12694069 ] 

Knut Anders Hatlen commented on DERBY-4102:
-------------------------------------------

The patch looks good to me. I've verified that the repro passes with the fix, and that the test case fails without the fix and passes with the fix.

> 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
>         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.


[jira] Commented: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-4102:
-----------------------------------

    Attachment: derby-4102-1a.stat
                derby-4102-1a.diff

Patch 1a is a prototype patch which passes the repro posted by Knut Anders. I have started the regression tests, and will post the results tomorrow.

The patch makes Derby store the stream as a temporary Blob (in the database's tmp directory). This is the same thing as is being done for small Blobs already.
Depending on the length of the stream, the temporary Blob will be held in memory or on disk.

I also had a look at the Clob implementation, and it turns out that it already works. However, that code path uses a different approach - it materializes the Clob into memory (see SQLChar.setFrom). I'll file a separate issue for this problem.

> 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
>         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.


[jira] Resolved: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan resolved DERBY-4102.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.5.3.1
                   10.4.2.1

The regression tests ran cleanly on both the 10.5 and 10.4 branch.
Merged fix into the 10.5 and 10.4 branches with revisions 903222 and 903223.

This should complete the work on this issue.

> 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.1.1, 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Kristian Waagan
>             Fix For: 10.4.2.1, 10.5.3.1, 10.6.0.0
>
>         Attachments: CastExc.java, derby-4102-1a.diff, derby-4102-1a.stat, java-deadlock.txt
>
>
> 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.


[jira] Updated: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4102:
--------------------------------------

    Attachment: CastExc.java

Attached is a Java program that reproduces the bug.

With sane jars:

Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED: org.apache.derby.shared.common.sanity.AssertFailure'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87)
        at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
        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.EmbedResultSet.getBlob(EmbedResultSet.java:4000)
        at CastExc.main(CastExc.java:12)
Caused by: java.sql.SQLException: Java exception: 'ASSERT FAILED: org.apache.derby.shared.common.sanity.AssertFailure'.
        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)
        ... 8 more
Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED
        at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:98)
        at org.apache.derby.impl.jdbc.EmbedBlob.<init>(EmbedBlob.java:194)
        at org.apache.derby.impl.jdbc.EmbedResultSet.getBlob(EmbedResultSet.java:3998)
        ... 1 more

With insane jars:

Exception in thread "main" java.sql.SQLException: Java exception: 'org.apache.derby.iapi.types.RawToBinaryFormatStream cannot be cast to org.apache.derby.iapi.types.Resetable: java.lang.ClassCastException'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedResultSet.getBlob(Unknown Source)
        at CastExc.main(CastExc.java:12)
Caused by: java.sql.SQLException: Java exception: 'org.apache.derby.iapi.types.RawToBinaryFormatStream cannot be cast to org.apache.derby.iapi.types.Resetable: java.lang.ClassCastException'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        ... 9 more
Caused by: java.lang.ClassCastException: org.apache.derby.iapi.types.RawToBinaryFormatStream cannot be cast to org.apache.derby.iapi.types.Resetable
        at org.apache.derby.impl.jdbc.PositionedStoreStream.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedBlob.<init>(Unknown Source)
        ... 2 more

> 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
>         Attachments: CastExc.java
>
>
> 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.


[jira] Updated: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-4102:
-----------------------------------

    Derby Info: [Patch Available]

> 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
>         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.