What is your app supposed to do?
It could be a case where both are trying to load the repository at the same time and it's locked temporarily. What you may need to add to your code is something for process/thread synchronization. What happens if you try that?
System.UnauthorizedAccessException
Moderator: SourceGear
Re: System.UnauthorizedAccessException
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support
Re: System.UnauthorizedAccessException
The app as 4 different operations it performs: a) get latest version of a file or files, b) check-out a file or files, c) check-in a file or files and add to an existing label.
Each time the user requests one of these operations, the process is: 1) connect to vault repository, 2) perform selected operation, 3) close vault connection.
So, if two users were doing the same thing simultaneously, we are positing that this could cause the access violation.
The only problem is, this being an ASP.NET application, the threads are not under our control.
I'm thinking the only way to synchronize these operations would be to write some kind of stand-alone service that processes requests serially from a queue (like a database table). The ASP.NET application would just write the requests to the queue and wait for the service to process them.
That's a lot of development effort, however, so I was just wanting to explore any other options there might be.
David
Each time the user requests one of these operations, the process is: 1) connect to vault repository, 2) perform selected operation, 3) close vault connection.
So, if two users were doing the same thing simultaneously, we are positing that this could cause the access violation.
The only problem is, this being an ASP.NET application, the threads are not under our control.
I'm thinking the only way to synchronize these operations would be to write some kind of stand-alone service that processes requests serially from a queue (like a database table). The ASP.NET application would just write the requests to the queue and wait for the service to process them.
That's a lot of development effort, however, so I was just wanting to explore any other options there might be.
David
Re: System.UnauthorizedAccessException
I guess another option could be some kind of semaphore (again, maybe a record in a db table) that tells the system a vault operation is in progress. Then, before performing a vault operation, the ASP.NET would check for this semaphore. If it existed, it would wait until it disappeared. Once it was gone, it'd create the semaphore to halt anyone else, perform the operation, and then clear the semaphore.
Might not be as much dev effort though, but I could see that semaphore getting orphaned, so we'd want an easy way to reset it.
Does it sound like we're on the right track here in terms of just trying to avoid multi-user collisions?
David
Might not be as much dev effort though, but I could see that semaphore getting orphaned, so we'd want an easy way to reset it.
Does it sound like we're on the right track here in terms of just trying to avoid multi-user collisions?
David
Re: System.UnauthorizedAccessException
A semaphore could work (), or you might also look a using a named, system mutex - http://msdn.microsoft.com/en-us/library ... 85%29.aspx.
Beth Kieler
SourceGear Technical Support
SourceGear Technical Support