unless SAVEPOINT is being used, which is not the case here, session.rollback() rolls back the entire transaction, regardless of nesting. The purpose of nesting with "subtransactions" is so that several blocks of code can each specify that they "begin()" and "commit()" a transaction, independently of whether or not one of those methods calls the other. It is only the **outermost** begin()/commit() pair that has any effect, so the code here is equivalent to there being **no** begin()/commit() call in method_b() at all.
The "subtransactions" pattern exists mostly for the purposes of framework integrations and is not intended for general use.