Title.
This function also seems to have a void return so there is no feedback whatsoever on whether this function executed successfully or whether any cache was actually cleared.
According to the javadoc, this function should throw a GatewayException if the path is malformed, but it does not.
Tested in browser from a perspective view:
def runAction(self, event):
system.perspective.print("start test")
from java.lang import Throwable
try:
ret = system.db.clearNamedQueryCache(path = "blablabla")
system.perspective.print("ret: %s" % (repr(ret)))
except Throwable as t:
system.perspective.print("caught Throwable: %s" % (repr(t)))
except Exception as e:
system.perspective.print("caught Exception: %s" % (repr(e)))
system.perspective.print("end test")
self.props.value = 0
Expected output: "caught Throwable"
Acutal output:
View JSON
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 500,
"width": 700
}
},
"root": {
"children": [
{
"meta": {
"name": "TextArea"
},
"position": {
"basis": "160px",
"grow": 1
},
"props": {
"text": "---\nNone\n---\n"
},
"type": "ia.input.text-area"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.print(\"start test\")\n\tfrom java.lang import Throwable\n\t\n\ttry:\n\t\tret \u003d system.db.clearNamedQueryCache(path \u003d \"blablabla\")\n\t\tsystem.perspective.print(\"ret: %s\" % (repr(ret)))\n\texcept Throwable as t:\n\t\tsystem.perspective.print(\"caught Throwable: %s\" % (repr(t)))\n\texcept Exception as e:\n\t\tsystem.perspective.print(\"caught Exception: %s\" % (repr(e)))\n\t\n\tsystem.perspective.print(\"end test\")\n\tself.props.value \u003d 0\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "OneShotButton"
},
"position": {
"basis": "34px"
},
"props": {
"readyState": {
"icon": {
"style": {
"height": "24px",
"width": "2rem"
}
},
"text": "Run"
},
"writingState": {
"icon": {
"path": "material/hourglass_empty",
"style": {
"height": "24px",
"width": "2rem"
}
},
"text": "Busy..."
}
},
"type": "ia.input.oneshotbutton"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}