# One ajax request per commit with parent saving with children

**URL:** <https://discuss.emberjs.com/t/one-ajax-request-per-commit-with-parent-saving-with-children/2222>\
**Category:** Ember Data\
**Created:** [August 19, 2013, 8:33pm UTC](https://discuss.emberjs.com/t/one-ajax-request-per-commit-with-parent-saving-with-children/2222 "2013-08-19T20:33:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moger777](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/moger777/32/14722_2.png) [@moger777](https://discuss.emberjs.com/u/moger777)\
**Post date:** [August 19, 2013, 8:33pm UTC](https://discuss.emberjs.com/t/one-ajax-request-per-commit-with-parent-saving-with-children/2222/1 "2013-08-19T20:33:50Z")

</div>

Is it possible to do something as follows:

```javascript
  var p = App.Parent.createRecord()
  p.get('children').createRecord()
  p.get('children').createRecord()
  this.get('store').commit()

```

And have it fire off only one ajax request? If find I have to create the parent first, and then through a callback create the children which seems inefficient and won’t have the benefit of wrapping things in a database transaction server side. How can this be done properly with ember data?
