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

fixed throwing exception if a nested transaction occurs