public void release(Xid xid) {
final JavaEETransactionManager tm = transactionManager;
postInvokeTx(false, true);
try {
tm.release(xid);
} catch (javax.resource.spi.work.WorkException ex) {
throw new IllegalStateException(ex);
} finally {
if (tm instanceof JavaEETransactionManagerSimplified) {
((JavaEETransactionManagerSimplified) tm).clearThreadTx();