I'm running read-write transactions that are taking longer than 10 seconds, and they are timing out (failing with ABORTED
errors). Is there a way to specify a longer timeout?
There is no way to specify the timeout for a transaction, but you have a few options:
executeSql
request every 5-8 seconds
to keep your transaction alive. You can do a trivial query like
SELECT 1
. More info on idle transactions is here.You should consider whether you really need such a long read-write transaction. Read-write transactions use locks and other resources that can block other transactions from making progress. This is usually an anti-pattern to have such long-lived read-write transactions.