OperationContext ctx = OperationContextImpl.getContext();
if (ctx != null)
{
// if null it means there were no operations done before, hence no need to wait any completions
ctx.waitCompletion();
}
}
finally
{
OperationContextImpl.setContext(originalTX);