DatabaseComponent.generateBatch() now returns a boolean.

This allows a connection to know whether to try writing another batch
immediately, or to wait for an event from the DB.
This commit is contained in:
akwizgran
2011-09-20 14:45:07 +01:00
parent 75446b7f7e
commit 5548eb32cd
3 changed files with 24 additions and 24 deletions

View File

@@ -41,8 +41,8 @@ class BatchWriterImpl implements BatchWriter {
started = true;
}
// Allow one byte for the list end tag
int capacity = ProtocolConstants.MAX_PACKET_LENGTH
- (int) w.getBytesWritten() - 1;
int capacity =
ProtocolConstants.MAX_PACKET_LENGTH - (int) w.getBytesWritten() - 1;
if(capacity < message.length) return false;
// Bypass the writer and write each raw message directly
out.write(message);