BeginTransaction
Starts a SQL transaction.
A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours.
A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically.
DDL statements inside a transaction cause an implicit commit. We recommend that you run each DDL statement in a separate
ExecuteStatement
call with continueAfterTimeout
enabled.
Request Syntax
POST /BeginTransaction HTTP/1.1
Content-type: application/json
{
"database": "string
",
"resourceArn": "string
",
"schema": "string
",
"secretArn": "string
"
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- database
-
The name of the database.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 64.
Required: No
- resourceArn
-
The Amazon Resource Name (ARN) of the Aurora Serverless DB cluster.
Type: String
Length Constraints: Minimum length of 11. Maximum length of 100.
Required: Yes
- schema
-
The name of the database schema.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 64.
Required: No
- secretArn
-
The name or ARN of the secret that enables access to the DB cluster.
Type: String
Length Constraints: Minimum length of 11. Maximum length of 100.
Required: Yes
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"transactionId": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- transactionId
-
The transaction ID of the transaction started by the call.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 192.
Errors
- AccessDeniedException
-
You do not have sufficient access to perform this action.
HTTP Status Code: 403
- BadRequestException
-
There is an error in the call or in a SQL statement.
HTTP Status Code: 400
- ForbiddenException
-
There are insufficient privileges to make the call.
HTTP Status Code: 403
- InternalServerErrorException
-
An internal error occurred.
HTTP Status Code: 500
- ServiceUnavailableError
-
The service specified by the
resourceArn
parameter is not available.HTTP Status Code: 503
- StatementTimeoutException
-
The execution of the SQL statement timed out.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: