Throw exception if withTransaction == false during open external transaction.