(Note: I have a few options for work-arounds for this issue, but I'm looking for an answer to this specific problem. Feel free to suggest work-arounds, but I may not accept those as answers.)
I'm using SDK 10 for C# to import files into Laserfiche, attaching metadata and updating that metadata periodically. I have selected a method of queuing updates to Laserfiche, executing them on a single, long-running background thread in the context of a web application (IIS).
The problem I'm having is that Laserfiche eventually stops allowing log-ins with the following error, which is from the framework exception:
Invalid token for impersonation - it cannot be duplicated.
After researching online, I understand this error to be related to identity tokens associated with HTTP connections. Unfortunately, this is nothing I can affect directly from my end, and I'm not aware of how to configure Laserfiche to properly handle this situation. I've tried changing the lifecycle of various objects. It seems that, even with a new session and new repository registration, I cannot get any Laserfiche interaction to occur until I dispose of the background thread and start a new one. I suspect that possibly the credentials are being stored in a thread-static way.
I get this error regardless of login style. Using .LogIn(registration) and .LogIn(username, password, registration) both cause the problem (I have a LF user associated with an AD user).
link to details about this exception (http://stackoverflow.com/questions/8993293/windowsidentity-impersonate-in-asp-net-randomly-invalid-token-for-impersonation)
I don't want to doubt the Laserfiche SDK and developers, but is a bug in how Laserfiche handles its sessions and HTTP communication when executing multiple requests on a single, long-running thread? Is there a known work-around that won't require me to change my threading model?