Skip to content

Commit

Permalink
BUG memory leak sulle connessioni
Browse files Browse the repository at this point in the history
Chiudere sempre un iteratore remoto prima di aprirne uno nuovo
  • Loading branch information
mspasiano committed Jan 29, 2016
1 parent 2a71cae commit 49db918
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 39 deletions.
Expand Up @@ -84,7 +84,11 @@ public Forward doPredisponiPerLaFirma(ActionContext context) {
statoTrasmissioneBulk = ((StatoTrasmissione)bulk);
statoTrasmissioneBulk.setStato_trasmissione(statoTrasmissione);
bp.setModel(context, bulk);
bp.predisponiPerLaFirma(context);
try {
bp.predisponiPerLaFirma(context);
} finally {
bp.openIterator(context);
}
bp.openIterator(context);
return context.findDefaultForward();
} catch(Exception e) {
Expand Down Expand Up @@ -167,43 +171,14 @@ public Forward doBackSign(ActionContext context) {
statoTrasmissioneBulk = ((StatoTrasmissione)bulk);
statoTrasmissioneBulk.setStato_trasmissione(statoTrasmissione);
bp.setModel(context, bulk);
bp.sign(context, firmaOTPBulk);
bp.openIterator(context);
try {
bp.sign(context, firmaOTPBulk);
} finally {
bp.openIterator(context);
}
} catch(Exception e) {
return handleException(context,e);
}
return context.findDefaultForward();
}

public Forward doInvia(ActionContext context) {
try {
BulkBP firmaOTPBP = (BulkBP) context.createBusinessProcess("FirmaOTPBP");
firmaOTPBP.setModel(context, new FirmaOTPBulk());
context.addHookForward("firmaOTP",this,"doBackInvia");
return context.addBusinessProcess(firmaOTPBP);
} catch(Exception e) {
return handleException(context,e);
}
}

public Forward doBackInvia(ActionContext context) {
AbstractFirmaDigitaleDocContBP bp = (AbstractFirmaDigitaleDocContBP)context.getBusinessProcess();
OggettoBulk bulk = bp.getModel();
StatoTrasmissione statoTrasmissioneBulk = ((StatoTrasmissione)bulk);
HookForward caller = (HookForward)context.getCaller();
FirmaOTPBulk firmaOTPBulk = (FirmaOTPBulk) caller.getParameter("firmaOTP");
try {
fillModel(context);
String statoTrasmissione = statoTrasmissioneBulk.getStato_trasmissione();
bulk = (OggettoBulk)bp.getBulkInfo().getBulkClass().newInstance();
statoTrasmissioneBulk = ((StatoTrasmissione)bulk);
statoTrasmissioneBulk.setStato_trasmissione(statoTrasmissione);
bp.setModel(context, bulk);
bp.invia(context, firmaOTPBulk);
bp.openIterator(context);
} catch(Exception e) {
return handleException(context,e);
}
return context.findDefaultForward();
}
}
Expand Up @@ -253,11 +253,9 @@ public void eliminaPredisposizione(ActionContext context) throws BusinessProcess
List<StatoTrasmissione> selectedElements = getSelectedElements(context);
if (selectedElements == null || selectedElements.isEmpty())
throw new ApplicationException("Selezionare almeno un elemento!");
EJBCommonServices.closeRemoteIterator(getIterator());
for (StatoTrasmissione v_mandato_reversaleBulk : selectedElements) {
aggiornaStato(context, MandatoBulk.STATO_TRASMISSIONE_NON_INSERITO, v_mandato_reversaleBulk);
//Remmato per problemi sul documentale
//Folder folderMandato = (Folder) cmisService.getNodeByPath(v_mandato_reversaleBulk.getCMISPath(cmisService));
//folderMandato.deleteTree(true, UnfileObject.DELETE, false);
}
setMessage("Cancellazione effettuata correttamente.");
} catch (ApplicationException e) {
Expand Down Expand Up @@ -372,11 +370,13 @@ public void sign(ActionContext actioncontext, FirmaOTPBulk firmaOTPBulk) throws
if (selectelElements == null || selectelElements.isEmpty()){
throw new ApplicationException("Selezionare almeno un documento contabile!");
}
EJBCommonServices.closeRemoteIterator(getIterator());
addSomethingToSelectedElements(actioncontext, selectelElements);
executeSign(actioncontext, selectelElements, firmaOTPBulk);
}

protected void executeSign(ActionContext actioncontext, List<StatoTrasmissione> selectelElements, FirmaOTPBulk firmaOTPBulk) throws Exception{
EJBCommonServices.closeRemoteIterator(getIterator());
String webScriptURL = documentiContabiliService.getRepositoyURL().concat("service/sigla/firma/doccont");
Map<String, String> subjectDN = documentiContabiliService.getCertSubjectDN(firmaOTPBulk.getUserName(), firmaOTPBulk.getPassword());
if (subjectDN == null)
Expand Down Expand Up @@ -443,4 +443,4 @@ private String getTitolo() {
public void invia(ActionContext context, FirmaOTPBulk firmaOTPBulk) throws Exception {

}
}
}
Expand Up @@ -139,6 +139,7 @@ public void predisponiPerLaFirma(ActionContext actioncontext) throws BusinessPro
throw new ApplicationException("Selezionare almeno un elemento!");
Format dateFormat = new SimpleDateFormat("yyyy/MM/dd");
String message = "";
EJBCommonServices.closeRemoteIterator(getIterator());
addSomethingToSelectedElements(actioncontext, selectedElements);
for (StatoTrasmissione statoTrasmissione : selectedElements) {
V_mandato_reversaleBulk v_mandato_reversaleBulk = (V_mandato_reversaleBulk)statoTrasmissione;
Expand Down

0 comments on commit 49db918

Please sign in to comment.