On TTL when updating the record with the java client

Hello

We use the aerospike java client. We create and update records using execute and a UDF.

public final Object execute(WritePolicy policy, Key key, String packageName, String functionName, Value… args)

with policy.expiration = 864000 /10 days/

On the server side ‘functionName’ creates the record if it does not exist or updates (merges) it if exists.

Does updating the record reset the TTL?

On other words, if one creates a record on May 01 with a TTL of 10 days and then modifies the record on May 05, is the record going to expire on May 15 as opposed to May 10?

Thank you for your help

Hi Mlabour,

Executing a UDF honors the WritePolicy that you supply, including the expiration. Also, when your update a record via a UDF, the expiry is re-calculated.

I hope this helps

Peter

Just confirming: Using the java client directly to update as well honors the expiration write policy, right?

That is correct.