You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I noticed consistencyLevel cannot be set when using batchOps.
spring-data-cassandra 3.2.2 and 3.3.0
Cassandra 4.0.1 (3 nodes, replication factor:2)
For example, try executing this code that uses batchOps.
Right after this batch process finished, run a query(ONE) to read the deleted data(*1).
Even though ALL is specified in queries in batchOps, the read query sometimes returns the data that was deleted a while ago.
In a few seconds, the same read request always returns empty.
It looks like "ALL" for writing doesn't work.
Next, I tried running this code that set ConsistencyLevel.ALL via BatchStatementBuilder.
it worked as expected.
Queries to read the deleted data(*1) never find data even if right after this batch process finished.
However, the code above accesses the private "batch" field, so I don't think this is "legal" code.
Although StatementBuilder in DataStax Java Driver has public setConsistencyLevel, I cannot call it via Spring Data. Is there any reason it is not exposed to Spring Data users?
I'm not sure how much consistency levels apply to individual statements within a batch. Likely, not at all. However, we're properly propagating the consistency level into each statement. The batch statement is executed through CqlTemplate.queryForResultSet(…) so you could hook in there to update the consistency level.
We could consider applying generally QueryOptions to BatchStatementBuilder for setting options on the batch itself.
Hello,
I noticed consistencyLevel cannot be set when using batchOps.
For example, try executing this code that uses
batchOps
.Right after this batch process finished, run a query(ONE) to read the deleted data(*1).
Even though ALL is specified in queries in batchOps, the read query sometimes returns the data that was deleted a while ago.
In a few seconds, the same read request always returns empty.
It looks like "ALL" for writing doesn't work.
Next, I tried running this code that set
ConsistencyLevel.ALL
via BatchStatementBuilder.it worked as expected.
Queries to read the deleted data(*1) never find data even if right after this batch process finished.
However, the code above accesses the private "batch" field, so I don't think this is "legal" code.
Although StatementBuilder in DataStax Java Driver has public
setConsistencyLevel
, I cannot call it via Spring Data. Is there any reason it is not exposed to Spring Data users?Another trial is here.
wtetsu@d806d32
I tried to implement batchOps that can accept ConsistencyLevel.
It worked as expected.
Here are my questions:
Thank you.
The text was updated successfully, but these errors were encountered: