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

Question

Question

The specified operation is not recognized. (9051) - UpdateStatus

asked on September 17, 2021

Hi everyone,
We are using SDK 9.0 for our integrations, many applications use Laserfiche 9.2 as our main repository of documents, and we are going to migrate to Laserfiche 10.4.3, newer version, this will be accomplished by using briefcase to export/import data, and we are going to use SDK 9.0 to connect at two Laserfiche versions (because of data is huge and we are take many many weeks). As we have been implementing our changes using SDK 9.0, we have got this issue: "The Specified operation is not recognized" after using UpdateStatus() on Search instance, It happened randomly and I could say frequently, our code is:

 

using (Search _search = new Search(sesion))
{
    _search.Command = consulta;
    LongOperation _longOperacion = _search.BeginRun(false);
    while (!_longOperacion.IsCompleted)
    {
        Thread.Sleep(1000);
        _search.UpdateStatus();
    }
    SearchListingSettings _searchListingSettings = new SearchListingSettings();
    _searchListingSettings.EntryFilter = EntryTypeFilter.Documents;
    _searchListingSettings.AddColumn(SystemColumn.Id);

    using (SearchResultListing _searchResultListing = _search.GetResultListing(_searchListingSettings))
    {
        foreach (EntryListingRow _item in _searchResultListing)
        {
            this._Resultado.Add(int.Parse(_item.GetDatumAsString(SystemColumn.Id).Replace(",", string.Empty)));
        }
    }
}

 

The error is produced after executing _search.UpdateStatus(); in the posted code.

I'm sorry to ask it but, how could we fix this? Apparently, this haven´t happened before, and we haven´t changed the methods used, just the way we considered which repository to connect, and getting that session to be used in the unchanged methods.

 

I would appreciate any answer about it.

Regards,
 

 

0 0

Replies

replied on September 17, 2021

I don't have an answer, but you can rework your code to avoid that call. Since you don't do anything useful in the loop, you can leave it out by using one of the methods that blocks until the search is complete. Either `BeginRun(false)` or `Run()` should do it.

0 0
replied on September 17, 2021

Hi Brian,
Thanks for your quick answer about it, I will discuss it with our development team and I will comment later.

0 0
replied on January 26, 2022

Hello everyone, we have decided to use SDK 9.0 and SDK 10.4.2 in the same service to connect to our LFS 9.2 server and LFS 10.4.3 server respectively (using for LFRA multiple version on same project Referencing Multiple Versions of the Same Assembly in a Single Application (kentico.com)).
Using SDK 10.4.2 to connect to our LFS 10.4.3, and the same posted code earlier, but we still got error "The specified operation is not recognized. (9051)" randomly when using _search.UpdateStatus();.

How could we fix this issue? 
Any help would be appreciated.

0 0
replied on January 26, 2022

Is it possible that the search operation is being canceled by another application? Or could the LF server be restarting?  Check the admin console session list to see if the SDK application is being signed out somehow. The list will show the last activity and login time for each session.

Also, can you identify a pattern for when it happens?

0 0
replied on February 7, 2022

Hi Robert, i'm sorry for my delayed response, The same service is managing the connections in memory, could not be canceled by another application. The LF server is not restarting in every issue occured. Sometimes a connection is missed in the admin console session list, but not frequently, and we could see this randomly and when there are many concurrent requests, we are not sure is this about cloning session issues related, because in this way we can manage many requests of search and exports.

0 0
replied on February 15, 2022

Laserfiche Support is looking into this problem. We usually need the full source code to debug this kind of issue.

0 0
replied on February 25, 2022

After inspecting the code, the problem was found to be that the SDK application was mixing LFSO and RepositoryAccess (RA) for session management. Instead of signing in with LFSO and cloning the connection to be used by RA, the application should remove all LFSO references and sign in using RA.  By mixing LFSO and RA, the background session ping thread was not running and this caused the session to time out.

1 0
replied on March 3, 2022

Hi Robert, we have discussed with our development team about removing all LFSO references, and we want to know, is there a way of cloning using LFRA (RepositoryAccess)? The advantages using cloning are significant because it allows us to perform operations in parallel, and we don´t want to lose that functionality with SDK. Or is there a recommendation or example to do so? We want to analyze our options in this scenario.

0 0
replied on March 3, 2022

Can you elaborate on how cloning allows running operations in parallel? In general an application should be able to create one RepositoryAccess Session object and use that to perform multiple operations in parallel. The Session object is thread safe.

0 0
replied on March 7, 2022

Hi Robert, We have been having some issues in our development team, some years ago our development team created our application with LF SDK in order to maintain certain connections to Laserfiche Server and manage requests from other applications, they  found that using cloning allowed having concurrent requests better than having just a single connection, I can not detail deeply about it, but in general, the benefit was having many operations in parallel, so we can manage apps requests quickly. Have you have an example on using RA to manage more than one operation at the same time? Maybe we don't having the appropiate orientation about it.

0 0
replied on March 9, 2022

I don't think we have any documentation about that topic specifically. As Robbie said, the Session is meant to be usable for multiple simultaneous operations. So there's no real difference between handling one operation and multiple. Can you be more specific about the problems you are running into?

0 0
replied on March 10, 2022

You can accomplish parallel requests by having a pool of available sessions. On startup, your application creates multiple new sessions and stores them in a structure (like a List<Session>). Then when the application needs to make a request, it pops a session off of the list, performs the action, and puts the session back in the pool when it is no longer needed.

0 0
replied on March 11, 2022

Thanks, Robert and Brian, for your comments. In SDK 10.4 documentation, it's said about "RepositoryAccess can automatically create and simultaneously keep open multiple HTTP connections to a Laserfiche server for a single Laserfiche session", and in SDK 9.0 documentation: "The Laserfiche Server allows 15 simultaneous requests and/or operations per session". When we initially had implemented our application with SDK 9.0, we can not perform multiple operations with RA Session but cloning, could you show us using an example how to perform multiples operations per session using LFRA? There is no example for this kind of scenarios in SDK docs, isn´t it?

0 0
replied on March 15, 2022

Here is sample code to test using a single session to make multiple simultaneous requests:

Session session = Login(username, password);

int requestCount = 0;

// Have 10 threads that get the root folder in a loop
Parallel.For(0, 10, index =>
{
    for (int i = 0; i < 1000; i++)
    {
        FolderInfo root = Folder.GetFolderInfo(1, session);
        Interlocked.Increment(ref requestCount);
    }
});

Console.WriteLine($"Made {requestCount} requests");

 

0 0
replied on March 22, 2022

Thank you, Robert. Our development team is reviewing and testing our software using just LFRA so far. When they get more info I would post it here.

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

Sign in to reply to this post.