Issue Details (XML | Word | Printable)

Key: DERBY-428
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Bryan Pendleton
Reporter: Bernt M. Johnsen
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Derby

NetworkClient PreparedStatement.executeBatch() hangs if batch is too large (ArrayIndexOutOfBoundsException in Network Server)

Created: 01/Jul/05 04:59 PM   Updated: 02/May/07 11:14 PM
Return to search
Component/s: Network Client, Network Server
Affects Version/s: None
Fix Version/s: 10.1.3.2, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works b428.java 2006-02-20 07:15 AM Bryan Pendleton 1 kB
File Licensed for inclusion in ASF works derby-428.diff 2006-02-20 07:15 AM Bryan Pendleton 5 kB
File Licensed for inclusion in ASF works derby428_10_1.diff 2006-07-20 12:45 AM Kathey Marsden 5 kB
File Licensed for inclusion in ASF works derby428_10_1.stat 2006-07-20 12:47 AM Kathey Marsden 0.2 kB
Environment:
Linux atum01 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686 i686 i386 GNU/Linux
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)
Issue Links:
Reference
 

Resolution Date: 02/May/07 11:14 PM


 Description  « Hide
When running

        s.executeUpdate("create table t (i integer)");
        PreparedStatement p = c.prepareStatement("insert into t values(?)");
        for (int i=0; i<N; i++) {
            p.setInt(1,i);
            p.addBatch();
        }
        System.out.println("Ok");
        p.executeBatch();


If N is 9000
The server reports:

524272
java.lang.ArrayIndexOutOfBoundsException: 524272
        at org.apache.derby.impl.drda.DDMWriter.startDdm(DDMWriter.java:315)
        at org.apache.derby.impl.drda.DRDAConnThread.writeSQLCARD(DRDAConnThread.java:4937)
        at org.apache.derby.impl.drda.DRDAConnThread.writeSQLCARDs(DRDAConnThread.java:4898)
        at org.apache.derby.impl.drda.DRDAConnThread.writeSQLCARDs(DRDAConnThread.java:4888)
        at org.apache.derby.impl.drda.DRDAConnThread.checkWarning(DRDAConnThread.java:7239)
        at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(DRDAConnThread.java:3605)
        at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:859)
        at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:214)
agentThread[DRDAConnThread_3,5,main]

While the client hangs in executeBatch().

If N is 8000, the client gets the following Exception:
Exception in thread "main" org.apache.derby.client.am.BatchUpdateException: Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
        at org.apache.derby.client.am.Agent.endBatchedReadChain(Agent.java:267)
        at org.apache.derby.client.am.PreparedStatement.executeBatchRequestX(PreparedStatement.java:1596)
        at org.apache.derby.client.am.PreparedStatement.executeBatchX(PreparedStatement.java:1467)
        at org.apache.derby.client.am.PreparedStatement.executeBatch(PreparedStatement.java:945)
        at AOIB.main(AOIB.java:24)




 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Bryan Pendleton made changes - 17/Feb/06 06:37 AM
Field Original Value New Value
Assignee Bryan Pendleton [ bryanpendleton ]
Bryan Pendleton made changes - 20/Feb/06 07:15 AM
Attachment b428.java [ 12323182 ]
Attachment derby-428.diff [ 12323183 ]
Bryan Pendleton made changes - 20/Feb/06 07:15 AM
Other Info [Patch available]
Bryan Pendleton made changes - 23/Mar/06 01:25 AM
Other Info [Patch available]
Bryan Pendleton made changes - 23/Mar/06 01:26 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Fix Version/s 10.2.0.0 [ 11187 ]
Bernt M. Johnsen made changes - 24/Apr/06 08:00 PM
Status Resolved [ 5 ] Closed [ 6 ]
Kathey Marsden made changes - 19/Jul/06 04:12 AM
Resolution Fixed [ 1 ]
Status Closed [ 6 ] Reopened [ 4 ]
Kathey Marsden made changes - 19/Jul/06 04:14 AM
Assignee Bryan Pendleton [ bryanpendleton ] Kathey Marsden [ kmarsden ]
Fix Version/s 10.1.3.2 [ 12311972 ]
Component/s Network Server [ 11410 ]
Kathey Marsden made changes - 20/Jul/06 12:45 AM
Attachment derby428_10_1.diff [ 12337208 ]
Kathey Marsden made changes - 20/Jul/06 12:47 AM
Attachment derby428_10_1.stat [ 12337209 ]
Kathey Marsden made changes - 20/Jul/06 11:54 AM
Resolution Fixed [ 1 ]
Assignee Kathey Marsden [ kmarsden ] Bryan Pendleton [ bryanpendleton ]
Status Reopened [ 4 ] Resolved [ 5 ]
Øystein Grøvlen made changes - 23/Nov/06 01:02 PM
Link This issue relates to DERBY-2113 [ DERBY-2113 ]
Bernt M. Johnsen made changes - 19/Jan/07 10:16 AM
Status Resolved [ 5 ] Closed [ 6 ]
Kathey Marsden made changes - 02/May/07 11:13 PM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Kathey Marsden made changes - 02/May/07 11:14 PM
Status Reopened [ 4 ] Closed [ 6 ]
Resolution Fixed [ 1 ]