fixed throwing exception if a nested transaction occurs
added test
Merge pull request #2406 from gurbuzali/nested-transaction-fix/3.2.2

Nested transaction fix/3.2.2