updateAndGet

suspend fun updateAndGet(old: T, new: T, consistency: KandraConsistency? = null, ttlSeconds: Int? = null, serialConsistency: KandraConsistency = KandraConsistency.LOCAL_SERIAL): T

Same write as update, but returns the entity actually persisted — including the post-update @Version (and @UpdatedAt) values update computes internally and then discards. Use this whenever the caller needs those generated values, e.g. to make a subsequent optimistic-locked update()/updateAndGet() call against the same row without risking a spurious io.kandra.core.exception.KandraOptimisticLockException from reusing the stale pre-update version it already had — see GH #136.