Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I there a way to stop a service from executing without restarting tomcat?
Solved! Go to Solution.
No from outside the service. But you can create a property called "stopExecution" (not persistent) and check on each iteration/whatever if it's true or not and exit.
No from outside the service. But you can create a property called "stopExecution" (not persistent) and check on each iteration/whatever if it's true or not and exit.
Even if I comment out the old code completely and save it keeps executing. It's like it keeps running the old version. I tried disabling the service and deactivating the Thing. Maybe if I delete it completely, but that seems like overkill.
/*while(me.lock==true)
{
var milliseconds = pause(1000);
logger.info('pausing');
}*/
If it let's you save the thing, then the thing should not be running, otherwise it won't let you save the thing. If you restart Tomcat, and look on the service code it's the new code or the old one?
I restarted tomcat, and the code was not commented out anymore (its the old code)!
Then you had a pending transaction behind the scenes, now that it's clean, you can edit it, once restarted all transactions are Ok.
Weird that it let me save then. Thanks for your help!
The reason that it let you "save" I think was as the previous code didn't do a "blocking" on the Thing, as it wasn't interacting with any persistent property, if the previous code did write on a persistent property then it won't let you save....
Well it was checking me.lock which is persistent, but not writing to it yes.
Reading it's not a problem, the blocking condition happens when you write on a persistent property.