Node.js client for Google Cloud Spanner: the world’s first fully managed relational database service to offer both strong consistency and horizontal scalability.
Expected: The initial call to ExecuteStreamingSql should fail, which also means that there is no transaction ID that is returned. The transaction is retried with an explicit BeginTransaction and then the invalid SQL + working SQL statement are executed again. Error will be thrown from the invalid SQL statement.
Actual: The initial call to ExecuteStreamingSql fails which initiates a explicit BeginTransaction as per this code . But since this request is not awaited, error is thrown to the catch block and begin transaction continues in parallel , ultimately throwing unhandled exception.
The Nodejs library does not handle below scenario, where the first query throws an error while trying to execute parallel queries in a transaction .
Expected: The initial call to ExecuteStreamingSql should fail, which also means that there is no transaction ID that is returned. The transaction is retried with an explicit BeginTransaction and then the invalid SQL + working SQL statement are executed again. Error will be thrown from the invalid SQL statement.
Actual: The initial call to ExecuteStreamingSql fails which initiates a explicit BeginTransaction as per this code . But since this request is not awaited, error is thrown to the catch block and begin transaction continues in parallel , ultimately throwing unhandled exception.