Jump to Content

New API Documentation - Developer Preview Available

We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.

Class BeginTransactionCommandProtected

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.

Example

Use a bare-bones client and the command you need to make an API call.

import { RDSDataClient, BeginTransactionCommand } from "@aws-sdk/client-rds-data"; // ES Modules import
// const { RDSDataClient, BeginTransactionCommand } = require("@aws-sdk/client-rds-data"); // CommonJS import
const client = new RDSDataClient(config);
const input = { // BeginTransactionRequest
resourceArn: "STRING_VALUE", // required
secretArn: "STRING_VALUE", // required
database: "STRING_VALUE",
schema: "STRING_VALUE",
};
const command = new BeginTransactionCommand(input);
const response = await client.send(command);
// { // BeginTransactionResponse
// transactionId: "STRING_VALUE",
// };

Param

BeginTransactionCommandInput

Returns

BeginTransactionCommandOutput

See

Throws

AccessDeniedException (client fault)

You do not have sufficient access to perform this action.

Throws

BadRequestException (client fault)

There is an error in the call or in a SQL statement.

Throws

ForbiddenException (client fault)

There are insufficient privileges to make the call.

Throws

InternalServerErrorException (server fault)

An internal error occurred.

Throws

ServiceUnavailableError (server fault)

The service specified by the resourceArn parameter is not available.

Throws

StatementTimeoutException (client fault)

The execution of the SQL statement timed out.

Throws

RDSDataServiceException

Base exception class for all service exceptions from RDSData service.

Hierarchy

Constructors

Properties

Methods