#4198 avoid calling startTransaction before possibly return
Merge pull request #4199 from dotCMS/issue-4198-transaction-left-open

#4198 avoid calling startTransaction before possibly return