I am a bit unclear about the way i should handle transactions inside a particular situation.

I have got a bit of code that boils lower for this:

from django.db import transaction

def process_post():
    #do stuff with database
    for reply in post_replies:

def process_post_reply(reply):
    #do stuff with database

I wish to understand what happens if your process_post_reply() fails.

So how exactly does commit_on_success handle being nested? Does it understand to commit each process_post_reply() or maybe one fails the entire process_post() comes back?

Here's the origin code from it: http://code.djangoproject.com/browser/django/tags/releases/1.2.4/django/db/transaction.py#L286

And enter_transaction_management is actually putting new transaction handling mode on thread stack.

So, inside your situation, if process_publish_reply() fails (i.e. exception happens), then transaction is folded in its whole, and so the exception advances upwards from process_publish() too but there's absolutely nothing to rollback.

With no, if a person process_publish_reply() fails then whole process_publish() isn't being folded back - there is no miracle there, only COMMIT and ROLLBACK on database level, meaning what's get folded back is just what's been writted to DB after last commited process_publish_reply().

Outlining, I believe that the thing you need is simply a single commit_on_success() around process_publish, possibly based on transaction savepoints - which regrettably can be found only in PostgreSQL after sales, despite the fact that MySQL 5.x supports them also.