public void deleteDcCoopsByCoopIdAndRegionMemberId(AdDcCoopBean dcCoop) throws ApplicationException { if (LOG.isLoggable(Level.FINER)) { LOG.entering( AdDcCoopCommandImpl.class.getName(), "deleteDcCoopsByCoopIdAndRegionMemberId", new Object[] {new Integer(dcCoop.getCoopId()), new Integer(dcCoop.getRegionMemberId())}); } boolean success = false; try { DBHelper.startTransaction(NFCCoreVariables.DATASOURCE_WAG_JNDI, false); cancelWorkflowForDcCoop(dcCoop); AdDcCoopManager.deleteDcCoopByCoopIdAndRegMbrId( dcCoop.getCoopId(), dcCoop.getRegionMemberId()); success = true; } finally { DBHelper.finalizeActiveTransaction(NFCCoreVariables.DATASOURCE_WAG_JNDI, success); } if (LOG.isLoggable(Level.FINER)) { LOG.exiting(AdDcCoopCommandImpl.class.getName(), "deleteDcCoopsByCoopIdAndRegionMemberId"); } }
protected boolean process(WorkflowTransactionPhase phase) throws WorkflowException { if (LOG.isLoggable(Level.FINER)) { LOG.entering(AutoRejectNewItemTransition.class.getName(), "process", new Object[] {phase}); } boolean success = false; boolean processed = false; try { DBHelper.startTransaction(); NewItemPlacementBean nipb = NewItemServicesUtils.getNewItemPlacementCommand() ._getActivePlacementByTransactionId(phase.getTransactionId()); long offset = Long.parseLong(DEFAULT_MAX_LENGTH_DAYS_OPEN); if (nipb != null) { if (handlesRegMbr(nipb.getRegionMemberId())) { DataItemBean dib = NewItemServicesUtils.getExpireDaysByRegionAlias( NewItemServicesUtils.getPlacementRegionMemberAliasById(nipb.getRegionMemberId())); if (dib != null) offset = Long.parseLong(dib.getValue()); this.triggerWhenBeforeOffset = new Long((-1) * offset * 24 * 60 * 60 * 1000); processed = super.process(phase); if (processed) { updateNewItemData(nipb); } } success = true; } else throw new WorkflowException( "Unable to locate placement data for AutoRejectNewItemTransition call on Transaction_ID [" + phase.getTransactionId() + "]."); } catch (WorkflowException we) { LOG.log( Level.SEVERE, "Error invoking AutoRejectNewItemTransition for New Item Workflow!", we); throw new WorkflowException( "Error invoking AutoRejectNewItemTransition for New Item Workflow! " + we.getMessage()); } catch (Throwable th) { LOG.log( Level.SEVERE, "Error invoking AutoRejectNewItemTransition for New Item Workflow for phase [" + phase.getId() + "]!", th); } finally { try { DBHelper.finalizeActiveTransaction(null, success); } catch (Throwable th) { LOG.log(Level.SEVERE, "Error finalizing transaction for AutoRejectNewItemTransition time!"); th.printStackTrace(); } } if (LOG.isLoggable(Level.FINER)) { LOG.exiting(AutoRejectNewItemTransition.class.getName(), "process"); } return processed; }
public void deleteDcCoopsByCoopId(int coopId) throws ApplicationException { boolean success = false; try { DBHelper.startTransaction(NFCCoreVariables.DATASOURCE_WAG_JNDI, false); AdDcCoopBean[] dcCoops = this.getAdDcCoopsByCoopId(coopId); for (int i = 0; dcCoops != null && i < dcCoops.length; i++) { deleteDcCoopsByCoopIdAndRegionMemberId(dcCoops[i]); } success = true; } finally { DBHelper.finalizeActiveTransaction(NFCCoreVariables.DATASOURCE_WAG_JNDI, success); } }