[ http://issues.apache.org/jira/browse/DERBY-1497?page=all ]
     
Andreas Korneliussen reopened DERBY-1497:
-----------------------------------------


Will update the fix so that a constructor of DisconnectException which takes 
Throwable is used.
After applying the new fix, the stack trace for the exception contains the 
following information when running the BlobOutOfMem repro in DERBY-550 on Java 
6 (Mustang):

java.sql.SQLException: Attempt to fully materialize lob data that is too large 
for the JVM.  The connection has been terminated.
        at 
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:94)
        at 
org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:344)
        at org.apache.derby.client.am.ResultSet.next(ResultSet.java:278)
        at derbytest.BlobOutOfMem.main(BlobOutOfMem.java:104)
Caused by: org.apache.derby.client.am.DisconnectException: Attempt to fully 
materialize lob data that is too large for the JVM.  The connection has been 
terminated.
        at 
org.apache.derby.client.net.NetStatementReply.copyEXTDTA(NetStatementReply.java:1486)
        at 
org.apache.derby.client.net.NetResultSetReply.parseCNTQRYreply(NetResultSetReply.java:139)
        at 
org.apache.derby.client.net.NetResultSetReply.readFetch(NetResultSetReply.java:41)
        at 
org.apache.derby.client.net.ResultSetReply.readFetch(ResultSetReply.java:40)
        at 
org.apache.derby.client.net.NetResultSet.readFetch_(NetResultSet.java:205)
        at org.apache.derby.client.am.ResultSet.flowFetch(ResultSet.java:4160)
        at 
org.apache.derby.client.net.NetCursor.getMoreData_(NetCursor.java:1182)
        at org.apache.derby.client.am.Cursor.stepNext(Cursor.java:176)
        at org.apache.derby.client.am.Cursor.next(Cursor.java:195)
        at org.apache.derby.client.am.ResultSet.nextX(ResultSet.java:299)
        at org.apache.derby.client.am.ResultSet.next(ResultSet.java:269)
        ... 1 more
Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2786)
        at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
        at org.apache.derby.client.net.Reply.getData(Reply.java:786)
        at 
org.apache.derby.client.net.NetStatementReply.copyEXTDTA(NetStatementReply.java:1478)
        ... 11 more


> assert failure in MessageUtil, because exception thrown with too many 
> parameters when handling OutOfMemoryError
> ---------------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1497
>          URL: http://issues.apache.org/jira/browse/DERBY-1497
>      Project: Derby
>         Type: Sub-task

>   Components: Network Client
>     Versions: 10.2.0.0
>     Reporter: Andreas Korneliussen
>     Assignee: Andreas Korneliussen
>     Priority: Trivial
>      Fix For: 10.2.0.0
>  Attachments: DERBY-1497.diff
>
> If the VM throws a OutOfMemoryException, which is caught in:
> NetStatementReply.copyEXTDTA:
>     protected void copyEXTDTA(NetCursor netCursor) throws DisconnectException 
> {
>         try {
>             parseLengthAndMatchCodePoint(CodePoint.EXTDTA);
>             byte[] data = null;
>             if (longValueForDecryption_ == null) {
>                 data = (getData(null)).toByteArray();
>             } else {
>                 data = longValueForDecryption_;
>                 dssLength_ = 0;
>                 longValueForDecryption_ = null;
>             }
>             netCursor.extdtaData_.add(data);
>         } catch (java.lang.OutOfMemoryError e) {     <--- outofmemory
>             agent_.accumulateChainBreakingReadExceptionAndThrow(new 
> DisconnectException(agent_,
>                 new ClientMessageId(SQLState.NET_LOB_DATA_TOO_LARGE_FOR_JVM),
>                 e));  <----- message does not take parameters, causing assert 
> failure
>         }
>     } 
> Instead of getting the message: java.sql.SQLException: Attempt to fully 
> materialize lob data that is too large for the JVM.  The connection has been 
> terminated.
> I am getting an assert: 
> Exception in thread "main" 
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Number of 
> parameters expected for message id 58009.C.6 (0) does not match number of 
> arguments received (1)
>         at 
> org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:119)
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to