Fixed BadSqlGrammarException usage in transaction test suite

Issue: SPR-10902
(cherry picked from commit ef66708)