We have been having a growing problem with a custom events registration form that we use. This is a sporadic problem, happens about 1 in every 5 page loads
Here is the error…
System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.MoveNext() at USNAWebservices.MasterService.getParticipantEvents(Int32 REID)
And here is my code
<WebMethod()> _
Public Function getParticipantEvents(ByVal REID As Integer) As ParticipantData
Dim RE7 As REAPI = initAPI()
Dim oEventParticipants As Blackbaud.PIA.RE7.BBREAPI.CRecord
oEventParticipants = New Blackbaud.PIA.RE7.BBREAPI.CRecord
Dim oParticipant As Blackbaud.PIA.RE7.BBREAPI.CParticipant
Try
If RE7 Is Nothing Then
RE7 = initAPI()
End If
If Not RE7 Is Nothing Then
Dim i As Integer
Dim oData As New ParticipantData
With oEventParticipants
.Init(RE7.SessionContext)
.Load(REID)
Dim oParticipantInfo As New ArrayList
For Each oParticipant In .Participants
If CType(oParticipant.EventObject.Fields(ESpecialEventFields.SPECIAL_EVENT_fld_START_DATE), Date) > Date.Today Then
Dim results As New ParticipantInfo
results = getParticipantEventsInfo(oParticipant.Fields(EParticipantsFields.Participants_fld_ID))
oParticipantInfo.Add(results)
Next
oData.Data = CType(oParticipantInfo.ToArray(GetType(ParticipantInfo)), ParticipantInfo())
End With
Return oData
Else
SendNotif("Unable to getParticipantEvents: API failed to initialize.")
Catch ex As Exception
SendError("ERROR: webservices: getParticipantEvents " & Now(), "Garrett.Keating@usna.com", ex.ToString, True)
Finally
oEventParticipants.CloseDown()
End Try
End Function
I found this article (BB330194) in the KB that says I should check to see if re7 is nothing and then re-init. That’s doesn’t seem to help.
The above code is designed to check the logged in constits future events and then pass that back to the custom part so it can pre-populate info if they have already signed up for the current event
This code resides in a webservice
any suggestions would be greatly appreciated!
Does oParticipant (Blackbaud.PIA.RE7.BBREAPI.CParticipant) have a closedown method? If so experiment with calling it inside the loop. In general, any object with a .closedown you must make sure you call closedown.
you could also try using this on any object cleanup..
if not myobject is nothing then
System.Runtime.InteropServices.ReleaseComObject (my object)
Set myobject = nothing
endif
this looks like it did the trick
i wasn't using the releaseCOMObject and i thnk that was the culprit....
dsSupport also recommended the same thing
thanks for the help!!!!