Hi Abdullah,
By default it is not a good idea to commit child-objects with an association to an uncommitted parent-object. This might result in issues with autocommitted objects. I'm wondering why you want to commit the child objects if you're not sure if the parent object will be committed or not. You might end up with orphaned objects.
My advice would be to implement the process in such a manner that you can either commit the parent first, or commit both parent and child objects at the same point in your process.
Greetings Martin