apache/shardingsphere · error · FirebirdProtocolException
BLOB policy is not supported in Firebird batch operations
Error message
BLOB policy is not supported in Firebird batch operations
What it means
FirebirdProtocolException thrown when the batch parameters clumplet contains TAG_BLOB_POLICY. The Firebird batch BLOB sub-protocol is not implemented in ShardingSphere, so any non-default BLOB policy request is rejected outright rather than silently mis-executed.
Source
Thrown at proxy/frontend/dialect/firebird/src/main/java/org/apache/shardingsphere/proxy/frontend/firebird/command/query/batch/FirebirdBatchCreateCommandExecutor.java:142
boolean recordCounts = false;
boolean multiError = false;
// int blobPolicy = BLOB_STREAM;
while (reader.isReadable()) {
ensureClumpletHeaderReadable(reader);
int tag = reader.readUnsignedByte();
int valueLength = reader.readIntLE();
ensureClumpletValueReadable(reader, tag, valueLength);
if (TAG_MULTIERROR == tag) {
multiError = 0 != readIntegerValue(reader, tag, valueLength);
} else if (TAG_RECORD_COUNTS == tag) {
recordCounts = 0 != readIntegerValue(reader, tag, valueLength);
} else if (TAG_BUFFER_BYTES_SIZE == tag) {
bufferSize = getBufferSize(readIntegerValue(reader, tag, valueLength));
} else if (TAG_BLOB_POLICY == tag) {
// int requestedBlobPolicy = readIntegerValue(reader, tag, valueLength);
// blobPolicy = BLOB_STREAM == requestedBlobPolicy ? requestedBlobPolicy : BLOB_STREAM;
// TODO Support BLOB policy after implementing the Firebird batch BLOB subprotocol.
throw new FirebirdProtocolException("BLOB policy is not supported in Firebird batch operations");
} else {
reader.skipBytes(valueLength);
}
}
// return new BatchParameters(version, bufferSize, recordCounts, multiError, blobPolicy);
return new BatchParameters(version, bufferSize, recordCounts, multiError);
}
private static long getBufferSize(final int requestedBufferSize) {
long result = Integer.toUnsignedLong(requestedBufferSize);
return 0L == result ? MAX_BUFFER_SIZE : Math.min(result, MAX_BUFFER_SIZE);
}
private static void ensureClumpletHeaderReadable(final ByteBuf reader) {
if (reader.readableBytes() < 1 + WIDE_CLUMPLET_LENGTH_SIZE) {
throw new FirebirdProtocolException("Invalid batch parameters buffer");
}
}View on GitHub (pinned to e952770a21)
Solutions
- Do not set a batch BLOB policy; rely on default stream BLOB handling, i.e. keep BLOB parameters out of the batch or bind them through the normal blob API.
- Move BLOB-heavy inserts out of batch execution into single-row prepared execution.
- Track/upgrade to a ShardingSphere version that implements the Firebird batch BLOB sub-protocol if you need batched blobs.
Defensive patterns
Strategy: fallback
Try / catch
catch (SQLException e) {
if (e.getMessage().contains("BLOB policy is not supported")) {
batch.clear();
executeOneByOne(); // fallback: plain prepared-statement loop without batch blob policy
} else throw e;
} Prevention
- Keep BLOB columns out of batched statements.
- Never negotiate a batch blob policy against this proxy.
When it happens
Trigger: BatchParameters.parse() loops over clumplet tags; hitting TAG_BLOB_POLICY throws immediately (the code shows the intended handling commented out with a TODO for the BLOB subprotocol).
Common situations: a client that batches statements touching BLOB columns and explicitly negotiates a blob policy (e.g. BLOB_ID or BLOB_BUFFERED) instead of the default stream mode; newer Jaybird versions exposing batch blob policy knobs.
Related errors
- SEEK BLOB is not supported at the moment, blob handle: %d
- Truncated batch BLOB segment length
- Batch BLOB segment declares %d bytes, but only %d bytes rema
- Unknown blob information request type %d
- Unknown database information request type %d
AI-assisted analysis of apache/shardingsphere@e952770a21 (2026-08-14).
Data as JSON: /api/errors/541aa64709c18697.
Report an issue: GitHub.