Fixed handling of @Resource's shareable value

Issue: SPR-10931
(cherry picked from commit 7bc3e3b)
Removed S0 from BadSqlGrammarException codes

S0 doesn't seem to be universally used for SQL grammar problems: see MS SQL Server's RAISERROR. This was reported years back; not sure why the fix didn't actually appear in the codebase back then.

Issue: SPR-10902
(cherry picked from commit d9b6203)
Fixed BadSqlGrammarException usage in transaction test suite

Issue: SPR-10902