# Transaction using aerospike

**URL:** <https://discuss.aerospike.com/t/transaction-using-aerospike/4495>\
**Category:** Operations\
**Created:** [August 16, 2017, 10:57am UTC](https://discuss.aerospike.com/t/transaction-using-aerospike/4495 "2017-08-16T10:57:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [August 16, 2017, 7:35pm UTC](https://discuss.aerospike.com/t/transaction-using-aerospike/4495/2 "2017-08-16T19:35:09Z")

</div>

I believe you are looking for the “Read-modify-write” pattern: [http://www.aerospike.com/docs/client/java/usage/kvs/write.html#read-modify-write](http://www.aerospike.com/docs/client/java/usage/kvs/write.html#read-modify-write)

This is also discussed here:

> [@Significance of generation field in Write Policy](https://discuss.aerospike.com/t/significance-of-generation-field-in-write-poilicy/4463):
>
> Hi, While writing a record to database there is a field in WrietePolicy , which is generation. If I am explicitly setting it to 0 or 1 and next I am trying fetch the record I see the generation is incremented value equal to number of times the record is updated. Is this generation value decides different version of records in the device file (persisted records to file or ssd) ? Can client change this generation value to 1 always. I am not clear on the use of this generation field in WritePolicy…

---

_[View the full topic](https://discuss.aerospike.com/t/transaction-using-aerospike/4495)._
