Hello,
we make our production planning in a homemade from tailored to us.
Process Description: All full hours the data (so desired!) are recalculated and written to a table. This table is then the basis of various pages and reports. This works fine.
Only now I have the problem that this computation may take a 3 minutes. And as long as the data in this table are of course not yet complete.
One idea would be to create a further table and to fill with the first table, when the computing process would be completed, and to take as a basis for the pages and reports. This way I should be able to reduce the time. But no I can not exclude it either.
How could I solve this.
0
Comments
Can I disable access to that table as long as the calculation runs.
I ask this because I was thinking to a SingleIstance Codeunit that switch on and off acess to that table.
I explain better:
1. Start Calculation
2. Call a function SingleIstanceCodeunit.DisableAcess 3. End Calculation
4. Call a function SingleIstanceCodeunit.ActivateAccess
in a report/page that try to access this page I'll do the following:
Something like that...
what do you think?
It works as expected... More or Less...
When you start the process lock the header, read the status of the flag if it is OK then change the flag modify and commit. Then run the routine, on completion undo the change with the reverse sequence.
Then before running any reports make sure first that the flag is consistent. Play with the logic of where you change the flag status in relation to your commits, and if the process crashes the status should be corrupt, so you need to manually fix it.
:?: I can't see how that will work. How can a SingleInstance code unit switch off access to a table? DO you mean by using some ADO or similar to directly access the SQL database directly?
No I don't.
Because of this I suggested to use it as "TrafficLight" in order to understand if calculation is ended.
Is it clear?
It works as expected... More or Less...
thanks
Sorry, the concept seems interesting, but I just don't understand how it will work. I must be missing something. :-k
Hmm I wonder if you actually read this, or just copy pasted from online help :-#
I read it what I'm doing wrong?
It works as expected... More or Less...
Maybe you didn't realize that a single instance code unit is PER SESSION. So if there are 100 users, then only the one user running the update will see this, the other 99 can just do what they want. And the person running the update in any case can't run a report at the same time, so it wont even help them.
Or the bit I didn't understand, is that maybe you have a way of "sharing" this semaphore across multiple clients, which is why I was interested. If you have than I would really like to know how. Otherwise I would have just ignored the post.
But I think it's easy to accomplish this using a field in a table using the same logic and in this way all users can read this field.
It works as expected... More or Less...
Pity then. I was hoping you had found some neat trick to do this. Adding a separate field (like I suggested above) is the way I always do it, because I don't like taking things like this outside of Navision. The issue though is always what happens when the session crashes or you lose connectivity etc. That's why I was hoping you had solved the issue with a single instance codeunit that would die when a session crashes.
I'm sorry for the misunderstanding...
It works as expected... More or Less...
Why? Learning is good. :thumbsup: