question

Burhan avatar image
Burhan asked Erick Ramirez commented

Getting error "Logged batches are not supported for this type of batch requests"

When I use Logged batches, it gives me the below error

"Logged batches are not supported for this type of batch requests"

Below is my code

BatchStatement.newInstance(BatchType.LOGGED).addAll(list);

batch
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

You didn't provide enough information to allow us to diagnose the issue you're facing. Ideally, we need to know (1) the version of Cassandra you're running, and (2) the full error message + the full stack trace.

I have to say that this error isn't generated by the Java driver or Cassandra so I suspect you're connecting to a database that isn't a true Cassandra cluster. Databases that pretend to be Cassandra have a lot of limitations and do not support all of Cassandra's features and functionality.

Both AWS Keyspaces (lack of functionality documented here) and Microsoft CosmosDB (unsupported features documented here) do not support logged batches. We don't provide support for AWS Keyspaces or CosmosDB so you'll need to contact AWS or Azure if you need help using their products. Cheers!

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi @Erick Ramirez ,

Thanks for responding.

We are using Microsoft Cosmos DB and as you mentioned that CosmosDB does not support Logged Batches, which means that we cannot implement Batch execution(to achieve atomicity) in Cosmos DB. Kindly let me know if my understanding is correct.

Thanks & Regards,

Burhan

0 Likes 0 ·

Correct. CosmosDB doesn't provide any ability to achieve atomic writes.

It would be remiss of me not to mention that DataStax's own Astra DB doesn't have such limitation. Logged batches work in Astra. Cheers!

0 Likes 0 ·