Author |
Message
|
DP1234 |
Posted: Tue Jun 17, 2014 4:46 am Post subject: Can we Flush Entire Global Cache at once?? |
|
|
Apprentice
Joined: 25 May 2014 Posts: 40
|
I've a Scenario where in I have to Flush or delete entire global cache contents at once...,how can I achieve this..? One way is to iterate through all the cache elements and delete them (performance issues). Is there any way or inbuilt function to flush the entire global cache at once. |
|
Back to top |
|
 |
exerk |
Posted: Tue Jun 17, 2014 5:24 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Global Cache of what? _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
DP1234 |
Posted: Tue Jun 17, 2014 5:27 am Post subject: |
|
|
Apprentice
Joined: 25 May 2014 Posts: 40
|
exerk wrote: |
Global Cache of what? |
Global Cache in IIB..,upon getting cache name as argument...i've flush that particular cache completley |
|
Back to top |
|
 |
exerk |
Posted: Tue Jun 17, 2014 6:05 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Moving this to the MESSAGE BROKER forum... _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
stoney |
Posted: Tue Jun 17, 2014 6:14 am Post subject: |
|
|
Centurion
Joined: 03 Apr 2013 Posts: 140
|
You can clear a map using mqsicacheadmin:
Code: |
mqsicacheadmin IB9NODE -c clearGrid -m myMapName |
|
|
Back to top |
|
 |
DP1234 |
Posted: Tue Jun 17, 2014 10:11 am Post subject: |
|
|
Apprentice
Joined: 25 May 2014 Posts: 40
|
stoney wrote: |
You can clear a map using mqsicacheadmin:
Code: |
mqsicacheadmin IB9NODE -c clearGrid -m myMapName |
|
i wanted to perform this action in JCN..How can i do that..?
I dont think JCN lets to run OS level commands..does it.? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 17, 2014 11:39 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
DP1234 wrote: |
I dont think JCN lets to run OS level commands..does it.? |
JCN allows you to do anything you can do in Java. The fact that you're allowed to do something doesn't make it a good idea, and a number of things you can do in a JCN will bring various parts of the software crashing down.
The question is why you want to clear the entire cache from inside a JCN. What exactly is this requirement?
For the record, "I've been given a requirement to clear the cache programatically" is not, in fact, a requirement. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Jun 17, 2014 5:46 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Vitor wrote: |
For the record, "I've been given a requirement to clear the cache programatically" is not, in fact, a requirement. |
I think you may need to explain that one. It maybe just as valid as
The requirement is that you do DR failover but you are not allowed to do any testing before the formal test begins. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 18, 2014 4:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
Vitor wrote: |
For the record, "I've been given a requirement to clear the cache programatically" is not, in fact, a requirement. |
I think you may need to explain that one. It maybe just as valid as
The requirement is that you do DR failover but you are not allowed to do any testing before the formal test begins. |
I'm looking for the reasoning behind clearing the cache programatically rather than via an administrative command separate to the running flow (but possibily still automated) or through cache expiry. What does the programatic option satisfy for the OP that the other options do not, and from this, are other & more satisfactory options open to them?
Explaination enough? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
DP1234 |
Posted: Wed Jun 18, 2014 5:29 am Post subject: |
|
|
Apprentice
Joined: 25 May 2014 Posts: 40
|
am trying to execute my mqsicacheadmin command thru Java
Process P = Runtime.getRuntime().exec();
can anybdy suggest how to write command inside exec() block if my is something like
C:\Program Files\IBM\MQSI\9.0.0.0>mqsicacheadmin IB9NODE -c clearGrid -m myMapName |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 18, 2014 5:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
DP1234 wrote: |
am trying to execute my mqsicacheadmin command thru Java |
One last time - why do you have to do this in Java? Why is this better that trying to spawn out another command shell (which is what that Java's doing), getting it correctly set up with mqsiprofile so the command works and then checking for the zero return code? None of which can of course have any adverse effects on the broker or expose any security risks. Honest.....
What is driving you to do this when easier options exist? Like just issuing the command outside of your flow from a properly configured shell? _________________ Honesty is the best policy.
Insanity is the best defence.
Last edited by Vitor on Wed Jun 18, 2014 5:35 am; edited 1 time in total |
|
Back to top |
|
 |
McueMart |
Posted: Wed Jun 18, 2014 5:35 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Well I wont write the java code for you, but one thing to bear in mind is that you might have to call mqsiprofile before you call mqsicacheadmin. |
|
Back to top |
|
 |
DP1234 |
Posted: Wed Jun 18, 2014 10:07 pm Post subject: |
|
|
Apprentice
Joined: 25 May 2014 Posts: 40
|
Is it possible to accomplish flushing entire data in psrticular map of global cache using Time to live concept..?
like this
MbGlobalMapSessionPolicy sessionPol = new MbGlobalMapSessionPolicy(60);
MbGlobalMap myMap = MbGlobalMap.getGlobalMap("myMap", sessionPol);
Running command through Java to delete cache is wrong approach is wat i felt after reading in couple of sites...and its not possible too
@Vitor...,thats wat the requirement is..we are trying of create an easier interface (not better though) (a SOAP request ) to clear the cache for the administrator instead of doing it in the command console (i agree it definatley hit performance) |
|
Back to top |
|
 |
iShakir |
Posted: Thu Jun 19, 2014 1:36 am Post subject: |
|
|
Apprentice
Joined: 07 Mar 2013 Posts: 47
|
Edit, that code you have written will ensure that any data written to the cache during your session lives for only 60 seconds, unless it is subsequently updated during that time.
I would also like to know why you would want to do this - especially if it's not satisfied by data expiry (time to live) |
|
Back to top |
|
 |
DP1234 |
Posted: Thu Jun 19, 2014 2:52 am Post subject: |
|
|
Apprentice
Joined: 25 May 2014 Posts: 40
|
iShakir wrote: |
Edit, that code you have written will ensure that any data written to the cache during your session lives for only 60 seconds, unless it is subsequently updated during that time.
I would also like to know why you would want to do this - especially if it's not satisfied by data expiry (time to live) |
I want to delete the map content completley something like what mqsicacheadmin clearGrid does... |
|
Back to top |
|
 |
|