Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 295
Herbert Avatar asked Feb 20 '20 07:02

Herbert


Video Answer


1 Answers

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.

like image 54
TheMaster Avatar answered Sep 28 '22 06:09

TheMaster