JDBC on Google Apps Script. Exception: Statement cancelled due to timeout or client request

こ雲淡風輕ζ 提交于 2020-04-28 09:59:22

问题


I am trying to fetch data from mySQL database on Google Cloud SQL using JDBC from Google Apps Script. However, I got this error:

Exception: Statement cancelled due to timeout or client request

I can fetch some other data successfully. However, some data I can't.

I execute one of the successful queries and one of the unsuccessful queries on mySQL workbench. I can execute the unsuccessful query with no problem on mySQL workbench.

I compared the durations.

Duration / Fetch
-------------------------------------------
Successful query:     0.140 sec / 0.016 sec
Unsuccessful query:   0.406 sec / 0.047 sec

The unsuccessful query seems to take longer. So, I set query timeout with:

stmt.setQueryTimeout(0);

intending to set no timeout (when the value is set to zero it means that the execution has no timeout limit). Then, I executed it on Google Apps Script.

However, it doesn't work and get the same error. Could you tell me a solution for this?


回答1:


This seems to be a known issue. Star ★ and comment on the issue to get Google developers to prioritise the issue. Until the issue is fixed, you can switch back to rhino runtime.



来源:https://stackoverflow.com/questions/60314840/jdbc-on-google-apps-script-exception-statement-cancelled-due-to-timeout-or-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!