You are viewing limited content. For full access, please sign in.

Question

Question

Error: The current request could not be performed because there are too many existing operations running

asked on March 3, 2014

I'm trying to pull all the file names  from Lasefiche database using .NET  and LF Api's.  I'm able to connect and pull some data but it throws "The current request could not be performed because there are too many existing operations running"  exception before all the records are processed. I'm using version 8.2 .

 

Thanks for your help.

 

 

0 0

Answer

APPROVED ANSWER
replied on March 3, 2014

If you are trying to run multiple searches, make sure that you dispose of the search objects after you extract the necessary data from them. This is true for most objects in the SDK - they represent resources being held on the server that are released when you dispose of the local object. Each user is limited in how many of these objects they can hold at a time, and they will get the error message you're seeing if they pass that limit.

1 0

Replies

replied on March 3, 2014

Thanks Mathew that resolved the error . Now I'm getting "System.Runtime.InteropServices.COMException (0xC004235B): The specified operation is not recognized.     at LFSO82Lib.ILFSearchResultListing.get_DatumByTemplateFieldAsString(Int32 Row, String FieldName)    

 

The code on that line is 

If LfSearchResults.DatumByTemplateFieldAsString(i, "Category - Personal Files") = "Something" Then

 

Any ideas ? Thanks for your help.

0 0
replied on March 3, 2014

Can you post a more complete version of the script? There's not enough here to know for sure what's going wrong. Feel free to change any sensitive string values and whatnot.

0 0
replied on March 3, 2014 Show version history

Dim LfSearchResults As LFSearchResultListing 

LfSearchResults   = Search()

 For i As Integer = 1 To LfSearchResults.RowCount
                            If LfSearchResults.DatumByTemplateFieldAsString(i, "Category - Personal Files") = "Something" Then

 

'''DO SOMETHING

 

End IF  ' end of if

 

 

Next  // end of for loop

 

 

 

 

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

SEARCH FUNCTION

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

 

Private Function Search() As LFSearchResultListing

        ' Creates the database object for the specified connection.

        ' Creates a search object for the database.
        Dim lfSearchObject As New LFSearch
        lfSearchObject = laserficheDB.CreateSearch
        ' Creates a search string which will be used to search the repository.  
        Try
            Dim searchstring As String = ""

            searchstring = "{LF:LookIn=""" + _filePath + _fundName + """, Subfolders=" + _subFolders + "}"

 

            If _startDate <> "" And _endDate <> "" Then
                searchstring += " &   {[Investment Files]:[Effective Date]>=""" + _startDate + """, <=""" + _endDate + """}"
            ElseIf _startDate <> "" And _endDate = "" Then
                searchstring += " &  {[Investment Files]:[Effective Date]>=""" + _startDate + """}"
            ElseIf _endDate <> "" And _startDate = "" Then
                searchstring += " & {[Investment Files]:[Effective Date]<=""" + _endDate + """}"
            End If

            If _subCategory <> "" Then
                searchstring += " & {[Investment Files]:[Sub-Category - Investment Files]=""*" + _subCategory + "*""} "
            End If
            If _category <> "" Then
                searchstring += " & {[Investment Files]:[Category - Investment Files]=""*" + _category + "*""} "
            End If

            If _searchText <> "" Then
                searchstring += " & (""" + _searchText + """ | {[]:[]=""*" + _searchText + "*""} | {[]:[]=""" + _searchText + """}) & {[Investment Files]}"
            End If
            ' Sets the search command to your search string.

            lfSearchObject.Command = searchstring
            ' Begins the search.
            lfSearchObject.BeginSearch(True)

            ' Continues to run the search until it is complete.
            While lfSearchObject.SearchStatus = Search_Status.SEARCH_STATUS_IN_PROGRESS
                
                lfSearchObject.UpdateSearchStatus()
            End While

        Catch ex As Exception

        End Try

        ' Specifies what information about search hits you want to retrieve.  
        ' Adds a column for each piece of information we will retrieve about the 
        ' folder.
        Dim params As LFSearchListingParams = New LFSearchListingParams
        params.AddStandardColumn(Column_Type.COLUMN_TYPE_ID)
        params.AddStandardColumn(Column_Type.COLUMN_TYPE_NAME)
        params.AddStandardColumn(Column_Type.COLUMN_TYPE_MIMETYPE)
        params.AddStandardColumn(Column_Type.COLUMN_TYPE_PATH)
        params.AddStandardColumn(Column_Type.COLUMN_TYPE_CREATEDATE)
        params.AddTemplateFieldColumn("Category - Personal Files")
        params.AddTemplateFieldColumn("Sub-Category - Personal Files")
        params.AddTemplateFieldColumn("Effective Date")
        params.AddTemplateFieldToSortBy("Effective Date", Sort_Direction.SORT_DIRECTION_DESC)
        ' Retrieves the specified information for the list of search hits.  The '0' 
        ' indicates that no rows will be pre-loaded.
        Dim results As LFSearchResultListing = lfSearchObject.GetSearchResultListing(params, 0)

        ' Returns the list of search results.
        lfSearchObject.Dispose()
        Return results

    End Function

 

 

 

 

0 0
replied on March 3, 2014

LfSearchResults.RowCount returns 100 count 

 

In the below for loop LfSearchResults.DatumByTemplateFieldAsString(i, "Category - Personal Files")  throws error when counter/row reaches 3 

 

 

For i As Integer = 1 To LfSearchResults.RowCount
                            If LfSearchResults.DatumByTemplateFieldAsString(i, "Category - Personal Files") = "Something" Then

 

 

0 0
replied on March 3, 2014

Can you post the contents of that loop? It seems like something you're doing in there is causing your search results object to get to an error state.

0 0
replied on March 3, 2014

Mathew, thanks for your help. I was able to figure out what was causing the error.  

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.