Skip to content

Instantly share code, notes, and snippets.

@tarun4279
tarun4279 / read-uncommitted.csv
Last active May 5, 2023 03:38
Database Isolation Levels
isolation_level transaction_anamolies_associated solution example
Read Uncommitted Dirty Reads + Non-Repeatable Reads + Phantom Reads No solution! it allows uncommitted data to be read. For example: suppose that at the start of the transfer transaction. Alice's account has a balance of $5000 and Bob's account has a balance of $3000. Alice's transfer transaction deducts $1000 from Alice's account so her account balance becomes $4000. However the transfer transaction has not yet been committed so if Bob initiates a read transaction to check his account balance he may see a balance of $4000 instead of the correct balance of $3000.
AWSSigner awsSigner = new AWSSigner(new DefaultAWSCredentialsProviderChain(), region.getName(), SERVICE_NAME,
() -> LocalDateTime.now(ZoneId.of("UTC")));
AWSSigningRequestInterceptor requestInterceptor = new AWSSigningRequestInterceptor(awsSigner);
// extract httpclient builder of the aws resource client and set the request interceptor
builder.addInterceptorLast(requestInterceptor);