The error appear in intervals of 20 minutes. Then I repeat the operation and the problem doesnt appear.
----
The trace of error:
Erro Mensagem: Collection was modified; enumeration operation may not execute.;
Erro Fonte: AToMSFramework;
Erro StackTrace: at AToMSFramework.CPersistenceBroker.retrieveObject(CPersistentObject& obj, Boolean useFind, Boolean useCache) in C:\Sistemas\Sigere\Fontes\AtomsFramework\CPersistenceBroker.vb:line 191 at AToMSFramework.CPersistentObject.Find(CPersistentObject& obj, Boolean useCache) in C:\Sistemas\Sigere\Fontes\AtomsFramework\CPersistentObject.vb:line 788 at AToMSFramework.CPersistentObject.Find(CPersistentObject& obj) in C:\Sistemas\Sigere\Fontes\AtomsFramework\CPersistentObject.vb:line 805 at Sigere.OrcamentoSIAFIIncluir.txtFR_TextChanged(Object sender, EventArgs e) in C:\Sistemas\Sigere\Fontes\Site\Orcamento\OrcamentoSIAFIIncluir.aspx.vb:line 682
----
The function:
Private Sub txtFR_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtFR.TextChanged
Dim obFR As Negocio.FonteRecurso ' Fonte de recurso.
Try
lblFRDesc.Text = ""
If txtFR.Text.Trim <> "" Then
obFR = New Negocio.FonteRecurso
obFR.Codigo = txtFR.Text.Trim
obFR.Find(obFR)
If obFR.Persistent Then
lblFRDesc.Text = obFR.DescricaoCompleta
Else
Throw New AvisoException(stAVISO_FONTE_CODIGO_INEXISTENTE)
End If
obFR = Nothing
Page.RegisterStartupScript("Focaliza", GUI.Script.ScriptControleFocaliza(txtND.ClientID))
End If
Catch obAviso As Sistema.AvisoException
lblMsgNegativaOrcamento.Text = obAviso.Message
Page.RegisterStartupScript("Focaliza", GUI.Script.ScriptControleFocaliza(txtFR.ClientID))
Catch obErro As Exception
Response.Write("Erro Mensagem: " & obErro.Message & "; Erro Fonte: " & obErro.Source & "; Erro StackTrace: " & obErro.StackTrace.ToString)
End Try
End Sub
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The error appear in intervals of 20 minutes. Then I repeat the operation and the problem doesnt appear.
----
The trace of error:
Erro Mensagem: Collection was modified; enumeration operation may not execute.;
Erro Fonte: AToMSFramework;
Erro StackTrace: at AToMSFramework.CPersistenceBroker.retrieveObject(CPersistentObject& obj, Boolean useFind, Boolean useCache) in C:\Sistemas\Sigere\Fontes\AtomsFramework\CPersistenceBroker.vb:line 191 at AToMSFramework.CPersistentObject.Find(CPersistentObject& obj, Boolean useCache) in C:\Sistemas\Sigere\Fontes\AtomsFramework\CPersistentObject.vb:line 788 at AToMSFramework.CPersistentObject.Find(CPersistentObject& obj) in C:\Sistemas\Sigere\Fontes\AtomsFramework\CPersistentObject.vb:line 805 at Sigere.OrcamentoSIAFIIncluir.txtFR_TextChanged(Object sender, EventArgs e) in C:\Sistemas\Sigere\Fontes\Site\Orcamento\OrcamentoSIAFIIncluir.aspx.vb:line 682
----
The function:
Private Sub txtFR_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtFR.TextChanged
Dim obFR As Negocio.FonteRecurso ' Fonte de recurso.
Try
lblFRDesc.Text = ""
If txtFR.Text.Trim <> "" Then
obFR = New Negocio.FonteRecurso
obFR.Codigo = txtFR.Text.Trim
obFR.Find(obFR)
If obFR.Persistent Then
lblFRDesc.Text = obFR.DescricaoCompleta
Else
Throw New AvisoException(stAVISO_FONTE_CODIGO_INEXISTENTE)
End If
obFR = Nothing
Page.RegisterStartupScript("Focaliza", GUI.Script.ScriptControleFocaliza(txtND.ClientID))
End If
Catch obAviso As Sistema.AvisoException
lblMsgNegativaOrcamento.Text = obAviso.Message
Page.RegisterStartupScript("Focaliza", GUI.Script.ScriptControleFocaliza(txtFR.ClientID))
Catch obErro As Exception
Response.Write("Erro Mensagem: " & obErro.Message & "; Erro Fonte: " & obErro.Source & "; Erro StackTrace: " & obErro.StackTrace.ToString)
End Try
End Sub
Hi Marcos,
Thanks for noticing that. I don't usually run my tests that long :-)
The problem comes from the cache expiry where an expired object is removed from the cache.
You can either grab the latest copy of CCacheEntry.vb from CVS or I can post the code for you.
- Richard