Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jjbom1990
Creator
Creator

Reload using batchfile in publisher

Hi Guys,

I am not sure if the title is very clear.

Right now I am in a bit of a pickle, I want to automate the publishing of an app on my server. Right now it is manual but should be able to be scheduled.

Because of some data import tasks(DW) I can't just schedule it at a certain time without some checking.

My current setup is like this:

Reload QlikView app. The first line it does is run a batch file. In this batchfile there is some logging done, and the QVD are reloaded with the "/R" command. It logs the current date in a separate file. After the Batch file is done the qlikview document is cheking if the Current date is the same as today en then it reloads the app. No this works perfect if I just reload the app by having the document open, however when I publish the app via publisher it does not seem to do the reload. Via the logging I am able to tell it gets to that point, and with some logging in the QVD reloader it seems that nothing is being done, not even being opened. Publisher is just saying it is running. It will go on indefinitely.

In QlikView the permission to run external programs is turned on (it works when I do a normal reload)

in QVDistributionService.exe.config key="EnableBatchMode"  is set to value="true"

As far as I know it should work, am I missing a config setting? anything at all?

thanks in advance! you can really help me out here!

Jasper

1 Solution

Accepted Solutions
jjbom1990
Creator
Creator
Author

Eventually I have it fixed in a different manner.

I am not using any batchfiles anymore.

The QVD reload is a scheduled task on publisher, the loop is placed in this document, and if the condition is met it starts to reload the document, if not after 30 minutes the reload is terminated by using a dummy expression.


I am crashing the script here!;

The reason why this is in here instead of just exit script, is because the reload of the app can only take place after the QVD reload has succeeded, the app reload is added to publisher with a trigger that it will reload when the QVD reload is finished. I am still able to do the logging and it is only able to reload when the previous imports are done.

Thanks all

View solution in original post

5 Replies
bindu_apte
Creator III
Creator III

Hi,

Hope this thread will help you.

how to execute bat file in qlikview server (qmc)

jjbom1990
Creator
Creator
Author

Hi,

The problem isn't running the bat file, it does that without problem (logging gives no problems)

the problem is that it isnt running the

"C:\Program Files\QlikView\Qv.exe" /R "F:\QlikView\Sourcedocuments\file.qvw"

command within the bat file.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

From your explanation, I can only guess that the reload is waiting for some interactive feedback which is of course impossible to pass on when running the tasks under QDS control. Try to pinpoint the exact spot where the Publisher seems to freeze.

As an alternate solution, did you ever consider reversing the chain of command and letting the DW trigger the QlikView reload task by sending an EDX signal whenever there is some real work to do? You could use QMSEDX Enhanced to do that.

jjbom1990
Creator
Creator
Author

Start log server

log kill qv server

taskkill /im qv.exe /F :: kill QlikView because of sharing errors

Set windows timestamp

echo ----------- New Reload %fullstamp% ----------- >> "F:\QlikView\Sourcedocuments\log.txt"

echo Stap1 %fullstamp% >> "F:\QlikView\Sourcedocuments\log.txt"

Log reload server

echo Stap2 %fullstamp% >> "F:\Synaxion\QlikView\Sourcedocuments\log.txt"

"C:\Program Files\QlikView\Qv.exe" /R  "F:\QlikView\Sourcedocuments\QVDReload.qvw"

echo Stap3 %fullstamp% >> "F:\Synaxion\QlikView\Sourcedocuments\log.txt" :: QVD reloaded

Log QVD reloaded server

echo %fullstamp% >> "F:\Synaxion\QlikView\Sourcedocuments\Trigger.txt" ::send trigger for app reload

echo Stap5 %fullstamp%  >> "F:\Synaxion\QlikView\Sourcedocuments\log.txt"

End Log server

exit

This is basically the Batch file. With a lot of logging, mostly for testing purposes. It stops working at the actual reload. Stap2 is getting logged then nothing, it keeps saying running while publishing, but I am not getting any logs that are being generated withing QVDReload, which happens on starting the script. It seems it just isn't doing that.

When I am reloading the app manually it goes without problems (except Encountered a sharing violation while accessing the qvw, thats why I have the kill qv.exe added to it that should work on the server manually I have it disabled) So I confirmed the actual script works.

I will read into the QMSEDX, right now the above solution is preferred because of logging to the server, perhaps it is possible with QMSEDX, but I will need to read into that.

Thanks for your help, if you find any problems in the above script or any other ideas why it isn't working please let me know!

jjbom1990
Creator
Creator
Author

Eventually I have it fixed in a different manner.

I am not using any batchfiles anymore.

The QVD reload is a scheduled task on publisher, the loop is placed in this document, and if the condition is met it starts to reload the document, if not after 30 minutes the reload is terminated by using a dummy expression.


I am crashing the script here!;

The reason why this is in here instead of just exit script, is because the reload of the app can only take place after the QVD reload has succeeded, the app reload is added to publisher with a trigger that it will reload when the QVD reload is finished. I am still able to do the logging and it is only able to reload when the previous imports are done.

Thanks all