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

Question

Question

Session/Connection is still open after close scanning interface when using LaunchScanning()

asked on March 26, 2015

Hello every one,

 

When calling lfclient.LaunchScanning(scanoptions) it will initiate new connection using specific username and password but after storing scanned pages and closing scanning interface; the connection is still open for about 3-4 minutes instead of disconnecting immediately, and this causing problem with users when they scan many files they reach the session limit on the fourth file.

 

Is there any solution to this issue or any way to overcome this bug?

1 0

Answer

SELECTED ANSWER
replied on March 26, 2015

Looks like this is a bug in scanning. As a workaround, you can manually kill the connection after scanning closes (launch scanning with WaitForExit=true). Call LFDatabase.GetAllConnections, find the connection that has matching username & has an ApplicationName containing "Laserfiche Scanning", and call Terminate() on it. This has to be from an admin account.

1 0

Replies

replied on June 27, 2016

LFDatabase is in LFSO. But I use RepositoryAccess reference and would like to avoid also referencing LFSO (one reason is that I understood that RA is a replacement for LFSO; maybe I am wrong there). Does RA have an equivalent of LFDatabase, or some other way of terminating connections ? I found RA.DatabaseInfo, but that only seems to be for a current connection.

thanks

0 0
replied on June 27, 2016

You are right, RA is the .NET equivalent of LFSO. Here is how to do it with RA:

string scanningUserName = <name of the user running scanning>;

using (var sessionReader = Repository.EnumSessions(session))
{
    foreach (SessionInfo sessInfo in sessionReader)
    {
        if (sessInfo.UserName.ToLower() == scanningUserName.ToLower() &&
            sessInfo.ApplicationName.ToLower().Contains("Laserfiche Scanning"))
        {
            Repository.TerminateSession(sessInfo.SessionId, session);
        }
    }
}

 

0 0
replied on June 27, 2016

Awesome, thanks !

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

Sign in to reply to this post.