/[Apache-SVN]
ViewVC logotype

Revision 387895


Jump to revision: Previous Next
Author: bpendleton
Date: Wed Mar 22 17:23:09 2006 UTC (18 years, 1 month ago)
Changed paths: 3
Log Message:
DERBY-428: PreparedStatement.executeBatch hangs if batch is too large

This patch contains a server-side change, a client-side change, and a test.

The server-side change is to call ensureLength() in DDMWriter.startDDM().
The DDMWriter working buffer is designed to dynamically grow to accomodate
the data being written; this dynamic growth is implemented using a coding
rule which requires that all DDMWriter internal routines must call
ensureLength to communicate the buffer size requirements prior to writing
bytes into the buffer. StartDDM was missing the call to ensureLength.

The client-side change is due to the fact that DRDA imposes a hard limit
of 65535 elements in a single correlated request because the correlation
identifier is a two byte unsigned integer. Prior to this change, the
correlation identifiers would wrap around when we added the 65536th
element into the batch, which breaks the DRDA protocol rule that requires
correlation IDs in a single request be always increasing. This change
causes the client to throw an exception if it is asked to execute a batch
containing more than 65534 elements. The reason for the number 65534,
rather than 65535, is that the value 0xFFFF is reserved for special use.



Changed paths

Path Details
Directorydb/derby/code/trunk/java/client/org/apache/derby/client/am/PreparedStatement.java modified , text changed
Directorydb/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java modified , text changed
Directorydb/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/prepStmt.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26