Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

QVD locks

Our application is a near realtime dashboard. We have data coming from two processes (A & B) that we need to integrate (java jobs). Those processes are not "talking" to each other but their data needs to end up in one dashboard. Each job writes text files with datetime stamps appended.

I am trying to figure out an approach that will avoid file locks. We dont have a "database" to handle locks for us. Are there any commands in Qlikview to handle locks and tell jobs to wait...for example wait until a qvd has finished being written?

If I use one document (qvw), and it is called by A to load/integrate A's data and then B calls the same document to integrate B's data, i would think we could get bad results even if process A does not lock the qvw while loading (if it does lock it, B will fail in some way). Lets say instance A is not complete before instance B starts. A will then finish up and the document will have only A's new data. B will have started after A but before it was complete so if it finishes after A, it will nuke the changes made by process A because they were not yet loaded when process B initiated the load.

So I could use 3 documents Process A could then load DocumentA that produces qvd_A. Process B loads DocumentB producing qvd_B. My third document, MyDashboard could then integrate qvd_A and qvd_B data. Problem here is when is it safe to load data into MyDashboard? If A calls MyDashboard then it might collide with process B writing to qvd_B and vice versa if B calls MyDashboard.

So, again! Any commands that can help me here or perhaps other strategies to handle this (other than strategies that involve changes to process A and B themselves).

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I need more info to give you a definitive answer. But you are right, you don't want to have two reloads running against the same document concurrentlly.

You say that A calls the qvw to reload but you don't specify the mechanism of the call. Is it triggering a batch file or EDX request?

If using the EDX request via Publisher, you have the QueueIfRunning parameter available. If the reload task is already running, this will queue another execution to run after the current one completes. I'll assume that the qvw reload loads the most current data from both A and B sources.

If you don't have Pubisher Enterprise (8.5, not sure how this works in V9), you won't be able to use the EDX method. An alternative would be to have A & B send a message to a queue to request a reload. Have a singleton java task that reads the queue and runs the reload requests serially. If you don't have a Queue Manager in place, you can implement the open source ActiveMQ -- or use Quartz -- both recommedations because you indicated the processes were java jobs.

-Rob

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I need more info to give you a definitive answer. But you are right, you don't want to have two reloads running against the same document concurrentlly.

You say that A calls the qvw to reload but you don't specify the mechanism of the call. Is it triggering a batch file or EDX request?

If using the EDX request via Publisher, you have the QueueIfRunning parameter available. If the reload task is already running, this will queue another execution to run after the current one completes. I'll assume that the qvw reload loads the most current data from both A and B sources.

If you don't have Pubisher Enterprise (8.5, not sure how this works in V9), you won't be able to use the EDX method. An alternative would be to have A & B send a message to a queue to request a reload. Have a singleton java task that reads the queue and runs the reload requests serially. If you don't have a Queue Manager in place, you can implement the open source ActiveMQ -- or use Quartz -- both recommedations because you indicated the processes were java jobs.

-Rob

Anonymous
Not applicable
Author

Thanks Rob...

The mechanism of the call - Two java apps that call someting like "c:\program files\Qlikview\QV.exe" /r /vAdaptorDataFile=status1234341234.csv status.qvw

The queue idea could work but the Java data stream applications would have to wait until the reload finished before continuing on writing data otherwise boom -> collisions but maybe that is what you mean by serially? Also, the file name does not have to change if we do it the way i think you are suggesting. I dont need the data to stick around in the text files.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP


Tim Webber wrote:but maybe that is what you mean by serially?


Yes, that's what I meant.

1. Wait for a message on the queue.
2. Start the qv.exe process and wait for it to complete.
Goto Step 1.

-Rob

Anonymous
Not applicable
Author

Great feedback...Thanks Rob