REST API query failing with: "com.glide.sys.TransactionCancelledException: Transaction cancelled: maximum number of SQL queries exceeded"

Surya Kiran La1
ServiceNow Employee
ServiceNow Employee

I created a staging table (u_sales_data_csv_stg) using "Load Data" feature under "System Import Sets". Data got loaded successfully.

When I try to use TABLE API (https://developer.servicenow.com/app.do#!/rest_api_doc?v=jakarta&id=c_TableAPI) to extract data from this staging table, I encounter the following error:

com.glide.sys.TransactionCancelledException: Transaction cancelled: maximum number of SQL queries exceeded

Also, I checked if there is any "Transaction Quota Rule" that is defined in the system to limit this. I did not find any.

Are you aware of any other reason why this is happening?

1 ACCEPTED SOLUTION

Surya Kiran La1
ServiceNow Employee
ServiceNow Employee

I am able to resolve the issue using the following steps:

As part of every "Transaction Quota Rule", there is a "Maximum SQL Queries" attribute. By default, the value for this attribute was 0 for "REST Aggregate API request timeout" transaction quote rule.

Increasing the value of "Maximum SQL Queries" to a higher number resolved the issue. 

 

find_real_file.png

View solution in original post

7 REPLIES 7

Harsh Vardhan
Giga Patron

may i know the number of records available on "u_sales_data_csv_stg" staging table ? 

you have data on staging table , now why are you using rest api here ? what's your exact requirement  ?

There are 50k rows in the staging table. We want to verify if all the data was uploaded correctly. So, we tried to use TABLE API to extract the data to reconcile if UPLOAD process did not obscure any data.

Are you aware of the exception, and is there a setting we could change to avoid it?

in this case extract the data in chunks. 

 

refer the below HI Article. 

https://hi.service-now.com/kb_view.do?sysparm_article=KB0727636

 

I am planning to use pagination (offset / limit) to extract data. However, the row count aggregate API (https://developer.servicenow.com/app.do#!/rest_api_doc?v=newyork&id=c_AggregateAPI) request is failing with this exception