Skip to content
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

TTL 0 (zero) not added to INSERT statement #1535

Closed
eduardmanda opened this issue Nov 14, 2024 · 2 comments
Closed

TTL 0 (zero) not added to INSERT statement #1535

eduardmanda opened this issue Nov 14, 2024 · 2 comments
Assignees
Labels
type: bug A general bug

Comments

@eduardmanda
Copy link

ttl 0 not working anymore when inserting
cassandraTemplate.insert(entity, InsertOptions.builder().ttl(0).build())

QueryOptionsUtil.addWriteOptions seems to be used and it ignores the ttl as it validates it to be !zero.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 14, 2024
@mp911de
Copy link
Member

mp911de commented Nov 14, 2024

We indeed do not propagate the TTL if it is zero. We need to represent an absent TTL in contrast to a zero-ttl. Probably, if we make TTL nullable, we can represent absence of a TTL specification.

@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 14, 2024
@mp911de mp911de self-assigned this Nov 14, 2024
@eduardmanda
Copy link
Author

Do you see any alternative currently? besides writing the statement.
We have an use case where the table has a default ttl and we want to alter that at insert based on certain conditions

@mp911de mp911de changed the title Ttl 0 not added to insert statement TTL 0 (zero) not added to INSERT statement Nov 15, 2024
@mp911de mp911de added type: bug A general bug and removed type: enhancement A general enhancement labels Nov 15, 2024
@mp911de mp911de added this to the 4.3.6 (2024.0.6) milestone Nov 15, 2024
mp911de added a commit that referenced this issue Nov 15, 2024
We now apply a zero TTL if it was set. Previously, we omitted zero TTLs and dropped these.

Closes #1535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants