DVA-C02 · Question #773
An application uses the Amazon RDS Data API to write data to a PostgreSQL database that is hosted in an Amazon Aurora DB cluster. The application receives predefined SQL queries in batches. Each batch
Sign in or unlock DVA-C02 to reveal the answer and full explanation for question #773. The question stem and answer options stay visible for context.
Question
An application uses the Amazon RDS Data API to write data to a PostgreSQL database that is hosted in an Amazon Aurora DB cluster. The application receives predefined SQL queries in batches. Each batch consists of a maximum of 10 queries. The application runs the SQL queries in a loop by using the ExecuteStatement API call. A developer observes that some queries fail. The developer must ensure that an automatic rollback happens whenever a query fails. Which solution will meet these requirements?
Options
- AImplement try-catch statements for the ExecuteStatement API call. Use Rollback Transaction API
- BImplement try-catch statements. Replace the ExecuteStatement API call with an ExecuteSql API
- CImplement try-catch statements. Replace the ExecuteStatement API call with a
- DImplement try-catch statements. Run the SQL queries within a transaction. Use Begin
Unlock DVA-C02 to see the answer
You've previewed enough free DVA-C02 questions. Unlock DVA-C02 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.