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
CassandraRepository.save(…) fails silently [DATACASS-445] #598
Comments
Mark Paluch commented Thanks Philipp Langer for filing the ticket. The mentioned behavior is an effect originating from a change regarding We can't determine reliably whether an object is new when persisting the object. Initially, we used From what I see now, our approach to always use Does this make sense? |
Philipp Langer commented Hi
Yes, regarding
Not sure if I got this right. Are we talking about read/write converter here? I guess that means it's not configurable on a per-query basis. What about if |
Mark Paluch commented So we will change
|
Mark Paluch commented That's fixed now. Care to give the snapshot artifact a try? <dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
<version>1.5.4.BUILD-SNAPSHOT</version>
</dependency> |
Philipp Langer commented Hi. I can confirm this bug to be fixed by version Thanks a lot. Good job |
Philipp Langer opened DATACASS-445 and commented
Hi folks. I think the implementation of
save(Object)
has a bug since version 1.5.2 of Spring Data Cassandra.Pre-Condition
An entity class with one (or more) fields annotated as the primary key and one or more non-primary key fields annotated as regular column values.
Scenario
save(Object)
of your CRUD Spring Data Repository for this entityScenario Results
That's because an UPDATE statement was performed (since primary key values are set). E.g.
UPDATE person SET name=null WHERE id="id1";
Usually, an UPDATE statement will create a new row if it does not exist. However, if all non-primary key columns are set to null, no row is created.
Expected Behaviour
Since the entity object is returned by
save(Object)
and no exception was thrown, I would expect that a CQL row was created or updated (i.e. the entity object was saved to Cassandra).Please let me know if that's the intended behaviour or if you consider this a bug as well.
Thank you for your efforts
Affects: 1.5.2 (Ingalls SR2)
Backported to: 1.5.4 (Ingalls SR4)
The text was updated successfully, but these errors were encountered: