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

Kathey Marsden commented on DERBY-5317:
---------------------------------------

Looking at the traces on 10.2 and trunk I see the following:

In the 10.2 trace on execution of the prepared update statement with the stream 
selected from the table we have:

[derby][Time:1310077705922][Thread:main][Clob@4d7784be] getCharacterStream () 
called
[derby][Time:1310077705922][Thread:main][Clob@4d7784be] getCharacterStream () 
returned java.io.StringReader@459484be

Followed by an EXCSQLSTT, SQLDTA and then EXTDTA to send the data.  I believe 
in this case the entire Clob has been materialized on the client.


With trunk we get an UpdateSensitiveClobLocater reader on the select instead of 
a regular StringReader:

[derby][Time:1310076968203][Thread:main][Clob@19981998] getCharacterStream () 
called
[derby][Time:1310076968203][Thread:main][Clob@19981998] getCharacterStream () 
returned org.apache.derby.client.am.UpdateSensitiveClobLocatorReader@dfe0dfe

followed by EXCSQLSTT, SQLDTA and then instead of the  EXTDTA a stored 
procedure call is attempted:
derby]        SEND BUFFER: PRPSQLSTT              (ASCII)           (EBCDIC)
[derby]        0 1 2 3 4 5 6 7   8 9 A B C D E F   0123456789ABCDEF  
0123456789ABCDEF
[derby] 0000   0068D05100010062  200D005E21130026  .h.Q...b ..^!..&  
..}........;....
[derby] 0010   776F6D6261743B74  7261636546696C65  wombat;traceFile  
.?_./..../....%.
[derby] 0020   3D74726163652E6F  75743B6372656174  =trace.out;creat  
.../...?....../.
[derby] 0030   653D747275650012  4E554C4C49442020  e=true..NULLID    
........+.<<....
[derby] 0040   2020202020202020  202000125359534C            ..SYSL  
...............<
[derby] 0050   4E30303020202020  2020202020205359  N000          SY  
+...............
[derby] 0060   534C564C30310004                    SLVL01..          .<.<....   
     
[derby] 
[derby]        SEND BUFFER: SQLSTT                 (ASCII)           (EBCDIC)
[derby] 0000   0039D04300010033  241400000000293F  .9.C...3$.....)?  
..}.............
[derby] 0010   203D2043414C4C20  53595349424D2E43   = CALL SYSIBM.C  
.....<<......(..
[derby] 0020   4C4F424745545355  42535452494E4728  LOBGETSUBSTRING(  
<|...........+..
[derby] 0030   3F2C203F2C203F29  FF                ?, ?, ?).         .........  
     


What seems to be happening is that we are all set up to stream the parameter 
data and that is what the server is expecting, but in order to get that  data 
from the stream  we need to make this stored procedure call, so we are stuck. 
Any thoughts on how to resolve this?  I don't see how we could interrupt the 
sending of the data to retrieve more with a stored procedure call. The current 
traces are too large to attach.  I will scale down the reproduction more to 
attach them.






> largeData/LobLimits.java  fails with NullPointerException in 
> org.apache.derby.client.net.Request.sendBytes()  with client
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5317
>                 URL: https://issues.apache.org/jira/browse/DERBY-5317
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.9.0.0
>            Reporter: Kathey Marsden
>            Assignee: Kathey Marsden
>         Attachments: Repro5317.java
>
>
> Investigating DERBY-5308, I found that the LobLimits.java test run with 
> client fails with a NullPointerException.
>  
> END setup
> ========================================
> START ClobTest #1  -insertClob of size = 2147483647
> Rows inserted with clob of size (2147483647) = 2
> ========================================
> ========================================
> START ClobTest #2 - SELECT CLOB of size = 2147483647
> Matched rows selected with clob of size(2147483647) =1
> ========================================
> ========================================
> START ClobTest #3 - SELECT CLOB of size = 2147483647
> Matched rows selected with clob of size(2147483647) =1
> ========================================
> ========================================
> START ClobTest #4 - select and then update clob of size= 2147483647 - Uses 
> setClob api
> FAIL -- Unexpected exception:
> java.lang.NullPointerException
>         at org.apache.derby.client.net.Request.sendBytes(Unknown Source)
>         at 
> org.apache.derby.client.net.Request.flushScalarStreamSegment(Unknown Source)
>         at 
> org.apache.derby.client.net.Request.padScalarStreamForError(Unknown Source)
>         at org.apache.derby.client.net.Request.writePlainScalarStream(Unknown 
> Source)
>         at org.apache.derby.client.net.Request.writeScalarStream(Unknown 
> Source)
>         at org.apache.derby.client.net.Request.writeScalarStream(Unknown 
> Source)
>         at 
> org.apache.derby.client.net.NetStatementRequest.buildEXTDTA(Unknown Source)
>         at 
> org.apache.derby.client.net.NetStatementRequest.writeExecute(Unknown Source)
>         at 
> org.apache.derby.client.net.NetPreparedStatement.writeExecute_(Unknown Source)
>         at org.apache.derby.client.am.PreparedStatement.writeExecute(Unknown 
> Source)
>         at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown 
> Source)
>         at 
> org.apache.derby.client.am.PreparedStatement.executeUpdateX(Unknown Source)
>         at org.apache.derby.client.am.PreparedStatement.executeUpdate(Unknown 
> Source)
>         at 
> org.apache.derbyTesting.functionTests.tests.largedata.LobLimits.selectUpdateClob(LobLimits.java:115
> 7)
>         at 
> org.apache.derbyTesting.functionTests.tests.largedata.LobLimits.clobTests(LobLimits.java:313)
>         at 
> org.apache.derbyTesting.functionTests.tests.largedata.LobLimits.runTests(LobLimits.java:177)
>         at 
> org.apache.derbyTesting.functionTests.tests.largedata.LobLimits.main(LobLimits.java:151)
> ========================================
> START ClobTest #12.1  -insertClob of size = 104857600
> NEGATIVE TEST - Expected Exception:
> EXPECTED SQL Exception: (08003) No current connection.
> ========================================
> START ClobTest #12.2 - SELECT CLOB of size = 104857600
> FAIL -- Unexpected exception:
> java.sql.SQLNonTransientConnectionException: No current connection.
>         at 
> org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown 
> Source)
>         at org.apache.derby.client.am.SqlException.getSQLException(Unknown 
> Source)
>         at org.apache.derby.client.am.PreparedStatement.setInt(Unknown Source)
>         at 
> org.apache.derbyTesting.functionTests.tests.largedata.LobLimits.selectClob(LobLimits.java:1007)
> In the derby.log I see
> derby.system.home=/local0/kmarsden/repro/largeData/testtrunkdnc/DerbyNetClient/LobLimits
> Database Class Loader started - derby.database.classpath=''
> Tue Jul 05 17:50:01 PDT 2011 Thread[DRDAConnThread_11,5,main] (DATABASE = 
> wombat), (DRDAID = .-580681567053183
> 269{2}), Execution failed because of a Distributed Protocol Error:  
> DRDA_Proto_SYNTAXRM; CODPNT arg  = 200d; E
> rror Code Value = 1d. Plaintext connection attempt from an SSL enabled client?
> Tue Jul 05 17:50:01 PDT 2011 : Execution failed because of a Distributed 
> Protocol Error:  DRDA_Proto_SYNTAXRM;
>  CODPNT arg  = 200d; Error Code Value = 1d. Plaintext connection attempt from 
> an SSL enabled client?
> org.apache.derby.impl.drda.DRDAProtocolException: Execution failed because of 
> a Distributed Protocol Error:  D
> RDA_Proto_SYNTAXRM; CODPNT arg  = 200d; Error Code Value = 1d. Plaintext 
> connection attempt from an SSL enable
> d client?
>         at org.apache.derby.impl.drda.DRDAConnThread.throwSyntaxrm(Unknown 
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.invalidCodePoint(Unknown 
> Source)
>         at 
> org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(Unknown 
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown 
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown 
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> Tue Jul 05 17:50:01 PDT 2011 Thread[DRDAConnThread_11,5,main] (DATABASE = 
> wombat), (DRDAID = .-580681567053183
> 269{2}), Execution failed because of a Distributed Protocol Error:  
> DRDA_Proto_SYNTAXRM; CODPNT arg  = 200d; E
> rror Code Value = 1d. Plaintext connection attempt from an SSL enabled client?
> Tue Jul 05 17:50:01 PDT 2011 : Execution failed because of a Distributed 
> Protocol Error:  DRDA_Proto_SYNTAXRM;
>  CODPNT arg  = 200d; Error Code Value = 1d. Plaintext connection attempt from 
> an SSL enabled client?
> org.apache.derby.impl.drda.DRDAProtocolException: Execution failed because of 
> a Distributed Protocol Error:  D
> RDA_Proto_SYNTAXRM; CODPNT arg  = 200d; Error Code Value = 1d. Plaintext 
> connection attempt from an SSL enable
> d client?
>         at org.apache.derby.impl.drda.DRDAConnThread.throwSyntaxrm(Unknown 
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.invalidCodePoint(Unknown 
> Source)
>         at 
> org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(Unknown 
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown 
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown 
> Source)
>         at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> ----------------------------------------------------------------
> Tue Jul 05 17:50:07 PDT 2011: Shutting down Derby engine
> ----------------------------------------------------------------
> Tue Jul 05 17:50:07 PDT 2011:
> To run the test, you have to remove largeData from DerbyNetClient.exclude and 
> run
> java -Dframework=DerbyNetClient 
> org.apache.derbyTesting.functionTests.harness.RunTest  
> org.apache.derbyTesting.functionTests.tests.lageData.LobLimits.
> It took about 3.5 hours to occur.
> I will work on a smaller reproduction.
>                                                                               
>               5,9           36%

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to