Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we run "kRunCacheManager.sh" using custom JSP file?

Highlighted
Shravan Kathuri
Senior Member

Can we run "kRunCacheManager.sh" using custom JSP file?

Hi,

Is it possible to run "kRunCacheManager.sh"
command using Custom JSP file.otherwise, is it possible to run ksc_ commands( or connecting to PPM application server..)?

Thanks
Shravan kumar.
21 REPLIES
Jason Nichols K
Honored Contributor

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Shravan,

Could explain a little more what you are trying to do? I have executed the kRunCacheManager.sh script from the Commands section of a Report Type, but not from a JSP itself. I'm not saying it can't be done, but if you are just looking to have the JSP do some DB updates and want to make sure the Cache is flushed, you can put it in a command line in the Report Type, if you are creating a Report Type.
Shravan Kathuri
Senior Member

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi Jason Nichols,

I am trying to run DB updates on the kcrt_request_details table.But it is not reflecting the updated values in the front end eventhough the table is updated with correct data. how can we show correct data in the front end by running db updates using custom JSP file?

Thanks
Shravan kumar.

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi,

what is the trigger of your JSP?
When is it doing the update?

The kRunCacheManager.sh can executed with Request Type Command or Workflow Command Execution.
Maybe you can combine JSP Execution with a Workflow Command Execution.....

Regards
Volker
Shravan Kathuri
Senior Member

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi,

I have a field in the request type which is of type link( i.e validation is link).Whenever user clicks on this link,the Custom JSP will be opening.At this time, i want to execute some of the DB update statements related to that particular request.I am updating data correctly, but it is not reflecting in front end? what else i have to do to reflect this updates in front end immediately.

Thanks
Shravan kumar.
Jason Nichols K
Honored Contributor

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Shravan,

I dig some research on a java call that can execute external commands. This is the Runtime.exec function. There are numerous examples of people using this execute external processes, including from JSPs. I haven't personally tried doing this yet, but from the discussions I've seen, it should be able to accomodate your requirement.

Jason
Shravan Kathuri
Senior Member

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi Jason Nichols,

Thanks for your quick response.I will try to use runtime exec functions.

Thanks
Shravan kumar
Erik Cole
Honored Contributor

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Shravan,

When you do your DB updates, are you also updating the LAST_UPDATE_DATE & LAST_UPDATED_BY fields? Sometimes, this is all you need to do. A page refresh will then capture the new data.
Shravan Kathuri
Senior Member

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi Erik Cole,

I am updating LAST_UPDATE_DATE field
but iam not updating LAST_UPDATED_BY field.
I will try to update this field also. And is it required to update "LAST_UPDATED_BY" field also?

Thanks
Shravan kumar.
Łukasz Czech
Collector

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi,

I suggest using execution step for flushing cache. After updating DB (I assume your run a PL/SQL function to make DB changes) you can add step (executed automatically or manually by user - your choice) to perform flush.
The execution step needs to have following step:
ksc_local_exec sh c:\ITG\bin\kRunCacheManager.sh A
[change path to fit your needs]
kev marks
Regular Collector

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hello,
we tried this in our DEV environment and it worked fine. But when we moved it to QA it did not work.

here is the error msg..
-------------------------------------
D:\ITGQA\bin>sh kRunCacheManager.sh A

'sh' is not recognized as an internal or external command, operable program or batch file.
-------------------------------------
We checked all of the environment variables between DEV and QA to see if anything was different but the Cygwin and Path variable had similar info.

Any suggestions as to why it works in DEV but not QA box.

thanks
Kevin
Jason Nichols K
Honored Contributor

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Are you manually calling this or is it in the script? If it's in the script, try specifying the full path to sh.
kev marks
Regular Collector

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

we created a request type and a workflow and built an execution step in the WF that uses the local_exec command
Jason Nichols K
Honored Contributor

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

With ksc_local_exec, you should specify the full path to sh. When I've run kRunCacheManager.sh in an execution command, I used ksc_connect to make sure all the appropriate env vars get set.
vamsee_1
Regular Collector

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi,

Just wanted to check if ksc_local_exec works even though the server is on windows OS or do you have to mention the cygwin path and then run the shell script.

I have done a lot of updates in my workflow from the backend using execution steps and in all my functions I have updated last_update_date which has served the purpose of flushing the cache. Make sure that you update the last_update_date of the entity as such - for example for kcrt_request_details you may also need to update last_update date in Kcrt_Requests .

In of the updates I need to update a table component from values in another table component which I have done successfully but this does not get reflected at the front end. For this I need to use anther execution step for calling the shell scirpt. My server is Windows OS and hence would like to know if ksc_local_exec will do the trick.
James++
Regular Collector

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi,

Yes you can RUN "kRunCacheManager.sh" using custom JSP file.

I am attaching the JAVA & JSP code, that are calling the kRunCacheManager.sh script.

The JSP code attached is a HP PPM Report, which is calling kRunCacheManager.sh script on execution. You have to modify it a bit.

Attachment: (Name - Code.zip)
1. ScriptTest.java
2. Run_Script.jsp

If still you are facing any issue, then please let me know.


Jyotir ++
Member

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi,

We can run 'kRunCacheManager.sh' from Cutom JSP files and we can also pass the parameter as well like for which entity we want to clear the Cache i.e RT,WF..etc.

If your DB update changes are not reflecting in RT on Frontend make sure you have updated data in all referenced table.

Make sure you are updating following columns.

1.Last_Updated_by
2.Last_update_date
3.Entity_Last_Update_date

Hope this will help you.

Regards,
Jyotir
Shravan Kathuri
Senior Member

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi Utkarsh Mishra,

I am not able to download the document.Can you please send the document to shravan.kathuri@ge.com.


Thanks
Shravan kumar.K
James++
Regular Collector

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Yes Sure...
Shravan Kathuri
Senior Member

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi Utkarsh Mishra,


You can pu the Custom JSP pages in any of the subfolders ( after the path itg.war/web/knta) and when you first open the page in IE, it will automatically gets compiled.No need to compile manually.

Thanks
Shravan kumar.K
Shravan Kathuri
Senior Member

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Hi Utkarsh Mishra,


You can put the Custom JSP pages in any of the subfolders ( after the path itg.war/web/knta) and when you first open the page in IE, it will automatically gets compiled.No need to compile manually.

Thanks
Shravan kumar.K
James++
Regular Collector

Re: Can we run "kRunCacheManager.sh" using custom JSP file?

Thanks a lot, I'll give it a try today.
//Add this to "OnDomLoad" event