[ 
https://issues.apache.org/jira/browse/DERBY-2381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12481369
 ] 

Kathey Marsden commented on DERBY-2381:
---------------------------------------

I am not having any luck getting a repro for this protocol problem outside of 
the test.  Below is my attempt to recreate what is happenning at the time of 
the error, but this passes just fine.

  public static void main(String[] args) throws Exception {
        
        Class.forName("org.apache.derby.jdbc.ClientDriver");
        Connection conn 
=DriverManager.getConnection("jdbc:derby://localhost:1527/wombat;create=true;traceFile=trace.out");
        Statement s = conn.createStatement();
        
        try {
            s.executeUpdate("DROP PROCEDURE PMP.TYPE_AS");
        } catch (SQLException se) {}
        
        String procSQL = "CREATE PROCEDURE PMP.TYPE_AS(" +
        "IN P1 " +   "SMALLINT" +
        ", INOUT P2 " + "SMALLINT" +
        ", OUT P3 " + "SMALLINT" +
                        
        ") LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL " +
        " EXTERNAL NAME 
'org.apache.derbyTesting.functionTests.util.ProcedureTest.pmap'";

        s.executeUpdate(procSQL);
        
        CallableStatement csp = conn.prepareCall("CALL PMP.TYPE_AS(?, ?, ?)");
        csp.registerOutParameter(2, java.sql.Types.INTEGER);
        csp.registerOutParameter(3, java.sql.Types.INTEGER);
        csp.setShort(1, (short) 32);
        csp.setInt(2, (short) 32);
        csp.execute();
         csp.getInt(2);
        csp.getInt(3);
        csp.registerOutParameter(2, java.sql.Types.BIGINT);
        csp.registerOutParameter(3, java.sql.Types.BIGINT);
        csp.setShort(1, (short) 32);
        csp.setInt(2, (short) 32);
       // Error should occur on execution
        csp.execute();
        
    }


> ParameterMappingTest fails due to ArrayIndexOutOfBoundsException  executing a 
> procedure
> ---------------------------------------------------------------------------------------
>
>                 Key: DERBY-2381
>                 URL: https://issues.apache.org/jira/browse/DERBY-2381
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.3.0.0
>            Reporter: Kathey Marsden
>
> The test ParameterMappingTest fails due to a connection reset error during 
> tearDown.  Commenting out the teardown actions I see that the real cause of 
> the connection reset is an ArrayIndexOutOfBoundsException executing a 
> callable statement.  I have not narrowed it down more than this.  Currently 
> the test runs only for embedded. It should be reenabled for client once this 
> bug is fixed.  Below is the stack trace:
> java.lang.ArrayIndexOutOfBoundsException
>       at java.lang.System.arraycopy(Native Method)
>       at org.apache.derby.client.net.Reply.shiftBuffer(Reply.java:107)
>       at 
> org.apache.derby.client.net.Reply.ensureSpaceInBufferForFill(Reply.java:153)
>       at org.apache.derby.client.net.Reply.fill(Reply.java:165)
>       at 
> org.apache.derby.client.net.Reply.ensureALayerDataInBuffer(Reply.java(Compiled
>  Code))
>       at org.apache.derby.client.net.Reply.readDssHeader(Reply.java:317)
>       at org.apache.derby.client.net.Reply.peekCodePoint(Reply.java:1008)
>       at 
> org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(NetStatementReply.java:324)
>       at 
> org.apache.derby.client.net.NetStatementReply.readExecuteCall(NetStatementReply.java:105)
>       at 
> org.apache.derby.client.net.StatementReply.readExecuteCall(StatementReply.java:75)
>       at 
> org.apache.derby.client.net.NetStatement.readExecuteCall_(NetStatement.java:176)
>       at 
> org.apache.derby.client.am.Statement.readExecuteCall(Statement.java:1464)
>       at 
> org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2151)
>       at 
> org.apache.derby.client.am.PreparedStatement.executeX(PreparedStatement.java:1571)
>       at 
> org.apache.derby.client.am.PreparedStatement.execute(PreparedStatement.java:1556)
>       at 
> org.apache.derbyTesting.functionTests.tests.jdbcapi.ParameterMappingTest.testParameterMapping(ParameterMappingTest.java:487)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
>       at java.lang.reflect.Method.invoke(Method.java:391)
>       at junit.framework.TestCase.runTest(TestCase.java:154)
>       at junit.framework.TestCase.runBare(TestCase.java:127)
>       at 
> org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:76)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:118)
>       at junit.framework.TestSuite.runTest(TestSuite.java:208)
>       at junit.framework.TestSuite.run(TestSuite.java:203)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.extensions.TestSetup.run(TestSetup.java:23)
>       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>       at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.extensions.TestSetup.run(TestSetup.java:23)
>       at 
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
>       at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

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