Hi –
I’m working on a project that involves users being able to use a custom web interface to upload documents into Laserfiche. We keep running into some issues that I’m looking for some clarity on.
Background
The way we have our system set up is that a user can upload as many files as they want in our application. Those files get uploaded to a temporary store in Microsoft Azure where they wait to be imported to LaserFiche. For each file that is added to the temp store, we send a message to our importer service that the file needs to be imported. Now, the importer service is configured such that it can run multi-threaded. Each time a file is uploaded, it generates the necessary import XML file, creates a Session, imports the file, and closes the session. If there is an error in the process, the session is closed.
Due to an error message we kept getting, we reduced the number of concurrent sessions to 2. However, the message still persists…
Here is the message :
Log in failed because the number of sessions has reached the licensed limit, or the user account has reached its session limit, or no named user license has been allocated to the user account. [9030]
What I would like to know is
* Is there a different way to create a session such that it can be used multiple times without this happening?
* Is a Repository User limited to 4 sessions? Or is it some other number?
* There used to be a setting in LaserFiche United called CanShareLicense, but it appears that in LaserFiche Avante and Rio this flag is not used. Is there some other equivalent setting?
* Is there a way to see how many active sessions are connected for a given user?
* If we are only using 2 threads (sessions) at a time, why do we continue to get this error? Is there some lag in when we issue Session.LogOut()?
We are planning for more users to be able to use the application but are hesitant to do so until we can get these errors resolved.
Code Sample
Here is the relevant code in our application:
private void UploadFile(string uploadFolder, string uploadPath, string importXmlPath) { try { using (var session = CreateSession()) { CreateUploadFolder(uploadFolder, uploadPath, session); UploadFiles(importXmlPath, uploadFolder, uploadPath, session); session.LogOut(); } } catch (Exception ex) { Log.Error(ex.Message); throw ex; } } private void UploadFiles(string importXmlPath, string uploadFolder, string uploadPath, Session session) { //this is a laserfiche file path var lfImportEngine = CreateImportEngine(uploadPath + "\\" + uploadFolder, _config.Volume, session); var import = lfImportEngine.BeginProcess(importXmlPath); while (!import.IsCompleted) { // wait for 1/10 second, and then refresh the status Thread.Sleep(100); import.Refresh(); } if (import.HasFailed) { session.LogOut(); Log.Error(import.FailureReason.Message); throw new Exception(import.FailureReason.Message); } Log.Information("Import Complete."); if (import.AllLoggedExceptions != null && import.AllLoggedExceptions.Count > 0) { session.LogOut(); string errors = ""; foreach (ImportEngineException e in import.AllLoggedExceptions) { errors += e.Message + "\\r\\n"; } Log.Error(errors); throw new Exception(errors); } }