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
Modular CachedPreparedStatementCreator [DATACASS-403] #570
Comments
Mark Paluch commented Thanks for your ticket. It would make sense for the upcoming 2.0 version, to extract a common ground for cache support so you can build an own implementation |
James Howe commented That's fine, I can probably just do it with a subclass for now |
Dmitro Lisnichenko commented It would be great if there was an option for a |
Mark Paluch commented I pushed a newly designed Care to give it a try? I'd love to get some feedback and what you think about it. <dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
<version>2.0.0.DATACASS-403-SNAPSHOT</version>
</dependency>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
</repository> |
James Howe commented The idea is you inject a Compared to the current version, subclasses cannot read the fields. |
Mark Paluch commented Thanks a lot for your feedback. It's up to you, whether you inject Regarding query options, I'd propose to use Regarding getters, I'm ok with adding a getter for the cache, as the cache might be of interest for outside users. As a subclass, you can intercept the values you're interested in within the constructor. Does this make sense? |
James Howe commented
|
Mark Paluch commented How about decorating We will cache prepared statements using the CQL-text only without regard to statement flags. The first prepared statements flags will apply to all prepared statements retrieved from |
James Howe commented I don't want to change what a single creator returns, I want an entirely new creator derived from the first one. |
Mark Paluch commented Exposing the internal state violates encapsulation. We don't want to expose these elements any further. Otherwise, we're constrained to additional API we can't change any more and the API isn't related to the exposed contract of a caching What's the reason for sticking to a subclass of |
John Blum commented Reviewed, polished and merged! Thank you! |
James Howe opened DATACASS-403 and commented
The driver version 3.1 changed how query idempotence is determined.
Any
BuiltStatements
from aQueryBuilder
will automatically determine their idempotence, but because they must be converted toString
in order to use the cache, this information is lost.If there were an alternate constructor that took a
Statement
instead of aString
, then the idempotence of the statement could be carried over to the prepared and bound statementsReference URL: http://docs.datastax.com/en/drivers/java/3.1/com/datastax/driver/core/Statement.html#isIdempotent--
Issue Links:
Referenced from: pull request #105
The text was updated successfully, but these errors were encountered: