|Re: P/Users, does not match outer scope rule [message #993841 is a reply to message #992231]
||Tue, 25 December 2012 17:35
| Lukas Huser
Registered: March 2010
It looks like you get this error because of conflicting scheduling rules while accessing a resource (a file or folder).
Code executed in one of the Scout model classes (such as execClickAction() on a button) is typically running inside a ClientSyncJob. All ClientSyncJobs are guaranteed to run sequentially; the current implementation is using a scheduling rule (ClientRule) which is set on the job. An ISchedulingRule basically represents a semaphore, allowing for exclusive access to a given resource, or in our case, for a sequential scheduling order. However, by design of the Jobs API, any given job can only aquire a single scheduling rule at the time (unless you are using hierarchical scheduling rules...).
An IResource (a file or a folder) also represents (inherits from) ISchedulingRule. Any (modifying) access to such a resource is guarded by the respective scheduling rule. We now get a runtime exception when trying to aquire the scheduling rule for such a resource, because we are already holding an (unrelated) scheduling rule in our ClientSyncJob.
For more information on the Jobs API and scheduling rules, see the following references:
As a workaround, it should be possible to start another ClientAsyncJob (which does not hold any scheduling rules) from within execClickAction to perform your resource related operations. You can wait for the async job to finish using the join() method.
Powered by FUDForum
. Page generated in 0.02049 seconds