-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add overloads to CassandraBatchOperations.insert(…)
accepting WriteOptions
#1135
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
May 22, 2021
mp911de
added
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Jun 7, 2021
mp911de
added
status: waiting-for-triage
An issue we've not yet triaged
and removed
type: bug
A general bug
labels
Jun 21, 2021
|
mp911de
added
type: enhancement
A general enhancement
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Jun 21, 2021
Actually, we could introduce overrides accepting a single entity and options since that seems to be used together on a regular basis. |
mp911de
changed the title
Cannot use CassandraBatchOperations (insert) with WriteOptions/InsertOptions
Add overloads to Jun 21, 2021
CassandraBatchOperations.insert(…)
accepting WriteOptions
mp911de
added a commit
that referenced
this issue
Jun 21, 2021
…lete(…) accepting WriteOptions. CassandraBatchOperations and its reactive variant provide now overloads accepting a single entity and WriteOptions. We also guard methods accepting varargs against being called with an accidental WriteOptions argument by inspecting the array of objects. Closes #1135
Hi, Im getting the same exception using the new api pointed out. here is my code: return reactiveCassandraTemplate
.batchOps()
.update(findDoctorAndUpdateIt(event, image))
.update(findDoctorBySpecialityAndUpdateIt(event, image))
.insert(new ProcessedEvent(event.id()), InsertOptions.builder().ttl(256000).build())
.execute()
.handle((writeResult, sink) -> {
if (writeResult.wasApplied()) {
sink.next(Done.getInstance());
return;
}
sink.error(new RuntimeException("WriteResult.wasApplied was false, something bad happened"));
}); Where am I doing wrong? Full stack trace:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using CassandraBatchOperations with WriteOptions I get:
com.datastax.oss.driver.api.core.type.codec.CodecNotFoundException: Codec not found for requested operation: [null <-> org.springframework.data.cassandra.core.cql.ExecutionProfileResolver$$Lambda$1007/555149775]
:WriteOptions ttlOption = WriteOptions.builder().ttl(ttl).build(); CassandraBatchOperations batchOperations = cassandraTemplate.batchOps(); batchOperations.insert(entity, ttlOption).execute();
The exception occurs in the QueryBuilder.class. From what I can see, ExecutionProfileResolver is added to the entity object so mapping does not work properly.
Used version:
org.springframework.boot
spring-boot-starter-data-cassandra
2.4.6
The text was updated successfully, but these errors were encountered: