Class TransactionCanceledException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- software.amazon.awssdk.core.exception.SdkException
-
- software.amazon.awssdk.core.exception.SdkServiceException
-
- software.amazon.awssdk.awscore.exception.AwsServiceException
-
- software.amazon.awssdk.services.dynamodb.model.DynamoDbException
-
- software.amazon.awssdk.services.dynamodb.model.TransactionCanceledException
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<TransactionCanceledException.Builder,TransactionCanceledException>
@Generated("software.amazon.awssdk:codegen") public final class TransactionCanceledException extends DynamoDbException implements ToCopyableBuilder<TransactionCanceledException.Builder,TransactionCanceledException>
The entire transaction request was canceled.
DynamoDB cancels a
TransactWriteItemsrequest under the following circumstances:-
A condition in one of the condition expressions is not met.
-
A table in the
TransactWriteItemsrequest is in a different account or region. -
More than one action in the
TransactWriteItemsoperation targets the same item. -
There is insufficient provisioned capacity for the transaction to be completed.
-
An item size becomes too large (larger than 400 KB), or a local secondary index (LSI) becomes too large, or a similar validation error occurs because of changes made by the transaction.
-
There is a user error, such as an invalid data format.
-
There is an ongoing
TransactWriteItemsoperation that conflicts with a concurrentTransactWriteItemsrequest. In this case theTransactWriteItemsoperation fails with aTransactionCanceledException.
DynamoDB cancels a
TransactGetItemsrequest under the following circumstances:-
There is an ongoing
TransactGetItemsoperation that conflicts with a concurrentPutItem,UpdateItem,DeleteItemorTransactWriteItemsrequest. In this case theTransactGetItemsoperation fails with aTransactionCanceledException. -
A table in the
TransactGetItemsrequest is in a different account or region. -
There is insufficient provisioned capacity for the transaction to be completed.
-
There is a user error, such as an invalid data format.
If using Java, DynamoDB lists the cancellation reasons on the
CancellationReasonsproperty. This property is not set for other languages. Transaction cancellation reasons are ordered in the order of requested items, if an item has no error it will haveNonecode andNullmessage.Cancellation reason codes and possible error messages:
-
No Errors:
-
Code:
None -
Message:
null
-
-
Conditional Check Failed:
-
Code:
ConditionalCheckFailed -
Message: The conditional request failed.
-
-
Item Collection Size Limit Exceeded:
-
Code:
ItemCollectionSizeLimitExceeded -
Message: Collection size exceeded.
-
-
Transaction Conflict:
-
Code:
TransactionConflict -
Message: Transaction is ongoing for the item.
-
-
Provisioned Throughput Exceeded:
-
Code:
ProvisionedThroughputExceeded -
Messages:
-
The level of configured provisioned throughput for the table was exceeded. Consider increasing your provisioning level with the UpdateTable API.
This Message is received when provisioned throughput is exceeded is on a provisioned DynamoDB table.
-
The level of configured provisioned throughput for one or more global secondary indexes of the table was exceeded. Consider increasing your provisioning level for the under-provisioned global secondary indexes with the UpdateTable API.
This message is returned when provisioned throughput is exceeded is on a provisioned GSI.
-
-
-
Throttling Error:
-
Code:
ThrottlingError -
Messages:
-
Throughput exceeds the current capacity of your table or index. DynamoDB is automatically scaling your table or index so please try again shortly. If exceptions persist, check if you have a hot key: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html.
This message is returned when writes get throttled on an On-Demand table as DynamoDB is automatically scaling the table.
-
Throughput exceeds the current capacity for one or more global secondary indexes. DynamoDB is automatically scaling your index so please try again shortly.
This message is returned when writes get throttled on an On-Demand GSI as DynamoDB is automatically scaling the GSI.
-
-
-
Validation Error:
-
Code:
ValidationError -
Messages:
-
One or more parameter values were invalid.
-
The update expression attempted to update the secondary index key beyond allowed size limits.
-
The update expression attempted to update the secondary index key to unsupported type.
-
An operand in the update expression has an incorrect data type.
-
Item size to update has exceeded the maximum allowed size.
-
Number overflow. Attempting to store a number with magnitude larger than supported range.
-
Type mismatch for attribute to update.
-
Nesting Levels have exceeded supported limits.
-
The document path provided in the update expression is invalid for update.
-
The provided expression refers to an attribute that does not exist in the item.
-
-
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTransactionCanceledException.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TransactionCanceledException.Builderbuilder()List<CancellationReason>cancellationReasons()A list of cancellation reasons.booleanhasCancellationReasons()For responses, this returns true if the service returned a value for the CancellationReasons property.List<SdkField<?>>sdkFields()static Class<? extends TransactionCanceledException.Builder>serializableBuilderClass()TransactionCanceledException.BuildertoBuilder()-
Methods inherited from class software.amazon.awssdk.awscore.exception.AwsServiceException
awsErrorDetails, getMessage, isClockSkewException, isThrottlingException
-
Methods inherited from class software.amazon.awssdk.core.exception.SdkServiceException
extendedRequestId, isRetryableException, requestId, statusCode
-
Methods inherited from class software.amazon.awssdk.core.exception.SdkException
create, retryable
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
toBuilder
public TransactionCanceledException.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<TransactionCanceledException.Builder,TransactionCanceledException>- Overrides:
toBuilderin classDynamoDbException
-
builder
public static TransactionCanceledException.Builder builder()
-
serializableBuilderClass
public static Class<? extends TransactionCanceledException.Builder> serializableBuilderClass()
-
hasCancellationReasons
public boolean hasCancellationReasons()
For responses, this returns true if the service returned a value for the CancellationReasons property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
cancellationReasons
public List<CancellationReason> cancellationReasons()
A list of cancellation reasons.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasCancellationReasons()method.- Returns:
- A list of cancellation reasons.
-
-