# Remove and create in a single transaction

**URL:** <https://dmap-community.ductus.global/t/remove-and-create-in-a-single-transaction/1424>\
**Category:** YANG\
**Created:** [July 21, 2017, 11:30am UTC](https://dmap-community.ductus.global/t/remove-and-create-in-a-single-transaction/1424 "2017-07-21T11:30:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mk2017](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mk2017](https://dmap-community.ductus.global/u/mk2017)\
**Post date:** [July 21, 2017, 11:30am UTC](https://dmap-community.ductus.global/t/remove-and-create-in-a-single-transaction/1424/1 "2017-07-21T11:30:27Z")

</div>

Hi  
I am new to confd.  
I have a basic doubt. I have created a list with a single leaf as follows

list abc {  
tailf:info “abc”;  
tailf:callpoint abcView {  
tailf:transform true;  
view:enable;  
}  
key xyz;  
leaf xyz {  
type uint32 {  
range “1…4294967295”;  
}  
mandatory true;  
}  
view:register-hook “abc”;  
}  
The register-hook attaches the createdb, get\_elem, set\_elem, removedb as callback functions

Now when i run the command as follows;

> abc xyz 1  
> commit

* * *

> no abc xyz 1  
> abc xyz 2  
> commit  
> In the last commit; first removedb for 1 gets called and then createdb for 2 gets called. Which is fine.

But if i do the following seq

> abc xyz 2  
> commit

* * *

> no abc xyz 2  
> abc xyz 1  
> commit

In the last commit, first createdb for 1 gets called and then removedb for 2 gets called.  
I did not understand why value of xyz (1 or 2) is deciding the sequence of hook functions.  
Can i control the sequence in this?

Thanks.

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [July 21, 2017, 2:25pm UTC](https://dmap-community.ductus.global/t/remove-and-create-in-a-single-transaction/1424/2 "2017-07-21T14:25:53Z")

</div>

Transactions logically happen all at once (the configuration changes you make in a transaction either all happen or none happen and the happen all at once).

This means that {create a, create b} is the same as {create b, create a}. The callbacks you get can come in any order and you should not assume anything else.
