JBPM-3814, BZ 1002724 Session thread safe support in JTA/EE environment (cherry picked from commit 2ae25dc025172f90582eeb8e65f8aa98bab050db)