Good morning,
My scenario is as follows. I notice that in a webservice that I have to use the integration engines, with each invocation in which I do AbreCompany and DateCompany the memory is rarely released. I know there will be a way to streamline this question, "using the Marshal." This scenario was spoken in a Spring training, as I was suggested to raise the question here by the trainer Sergio Sereno. Here's the order. Tks.
So here's a source code excerpt, though I think it's the same as many others. The negative rating was due to what specifically?
var motor = new ErpBS();
try
{
motor.AbreEmpresaTrabalho(EnumTipoPlataforma.tpProfissional, credenciaisPrimavera.Empresa, credenciaisPrimavera.Login, credenciaisPrimavera.Password);
GcpBEDocumentoInterno docInternoPrimavera =TransformaDocumentoInterno(motor, documento);
string erro = String.Empty;
motor.Comercial.Internos.Actualiza(docInternoPrimavera);
}
catch (Exception e)
{
log.Error("InserirDocumento failed", e);
resultado.Estado = new EstadoOperacao(CodigoEstado.OperacaoFalhou, e.Message);
}
finally
{
if(motor!= null) motor.FechaEmpresaTrabalho();
}