public void afterCompletion(int status) { if (removeContext) DataContext.remove(); }
public void beforeCompletion() { DataContext.publish(PublishMode.ON_COMMIT); if (removeContext) DataContext.remove(); }
public void doPublish(@Observes(during=TransactionPhase.BEFORE_COMPLETION) TideDataPublishingEvent event, Instance<UserTransaction> uts) { if (uts.isUnsatisfied() || uts.isAmbiguous()) { // No JTA UserTransaction, probably a servlet container // Anyway we should not be here return; } UserTransaction ut = uts.get(); try { if (!(ut.getStatus() == Status.STATUS_MARKED_ROLLBACK || ut.getStatus() == Status.STATUS_ROLLING_BACK || ut.getStatus() == Status.STATUS_ROLLING_BACK)) DataContext.publish(PublishMode.ON_COMMIT); } catch (SystemException e) { log.warn(e, "Could not get the current status of the transaction ???"); } if (event.getInitContext()) DataContext.remove(); } }
DataContext.remove();
DataContext.remove();
@Override protected void afterInvocationError(ServiceInvocationContext context, Throwable error) { String componentName = null; Class<?> componentClass = null; try { Object[] originArgs = (Object[])context.getMessage().getBody(); String operation = ((RemotingMessage)context.getMessage()).getOperation(); componentName = "invokeComponent".equals(operation) ? (String)originArgs[0] : null; String componentClassName = "invokeComponent".equals(operation) ? (String)originArgs[1] : null; try { if (componentClassName != null) componentClass = TypeUtil.forName(componentClassName); } catch (ClassNotFoundException e) { throw new ServiceException("Component class not found " + componentClassName, e); } } finally { tideContext.postCallFault(context, error, componentName, componentClass); } DataMergeContext.remove(); DataContext.remove(); } }
publishDataUpdates(); DataContext.remove();