/** * Locks an item for the duration of the transaction, unless it is already locked. Useful for isolated reads. * Returns the copy of the item as it exists so far in the transaction (if reading after a write in the same transaction) * * @param request * @throws DuplicateRequestException if the item in the request is already involved in this transaction * @throws ItemNotLockedException when another transaction is confirmed to have the lock on the item in the request * @throws TransactionCompletedException when the transaction has already completed * @throws TransactionNotFoundException if the transaction does not exist * @throws TransactionException on unexpected errors or unresolvable OCC contention */ public GetItemResult getItem(GetItemRequest request) throws DuplicateRequestException, ItemNotLockedException, TransactionCompletedException, TransactionNotFoundException, TransactionException { GetItem wrappedRequest = new GetItem(); wrappedRequest.setRequest(request); Map<String, AttributeValue> item = driveRequest(wrappedRequest); stripSpecialAttributes(item); GetItemResult result = new GetItemResult().withItem(item); return result; }