edited by
10,381 views
37 37 votes

​​​​An audit of a banking transactions system has found that on an earlier occasion, two joint holders of account $A$ attempted simultaneous transfers of Rs. $10000$ each from account $A$ to account $B$. Both transactions read the same value, Rs.$11000$, as the initial balance in $A$ and were allowed to go through. $B$ was credited Rs.$10000$ twice. $A$ was debited only once and ended up with a balance of Rs. $1000$.

Which of the following properties is/are certain to have been violated by the system?

  1. Atomicity
  2. Consistency
  3. Isolation
  4. Durability

4 Answers

27 27 votes

Given:

  • Account $A$ has $\text{Rs. 11,000.}$

  • Two simultaneous transfers of $\text{Rs. 10,000}$ each are attempted.

  • Account $B$ is credited twice (total $\text{Rs. 20,000}$).

  • Account $A$ is debited only once (final balance $\text{Rs. 1,000}$).

Analysis of ACID Properties:

  1. Atomicity:
    Ensures all parts of a transaction are completed or none are.
    Each transfer individually was complete (money was debited from $A$ and credited to $B$), so atomicity is likely not violated.
    $✘$ Not necessarily violated.

  2. Consistency:
    Ensures that the database moves from one valid state to another.
    If $\text{Rs. 20,000}$ was credited to $B$, $\text{Rs. 20,000}$ should be debited from $A$.
    But only $\text{Rs. 10,000}$ was debited. This breaks balance rules.
    $✓$ Violated.

  3. Isolation:
    Ensures concurrent transactions do not interfere with each other.
    Both transactions read the same initial balance ( $\text{Rs. 11,000}$) and proceeded independently, leading to an incorrect final state.
    This is a classic lost update.
    $✓$Violated.

  4. Durability:
    Ensures that once a transaction is committed, it remains so even in case of failure.
    No crash or rollback problem here.
    $✘$ Not violated.

Only $\color{red}{\text{Consistency}}$ and $\color{red}{\text{Isolation}}$ are violated. 

Hence,  Correct Answer :-  ${B,C}$

edited by
11 11 votes

Two transactions, ( $T_1$ ) and ( $T_2 $), each attempt to transfer ₹10,000 from account ( A ) (initial balance ₹11,000) to account ( B ). Due to inadequate concurrency control, the following interleaving occurs:

$$
\begin{array}{|c|c|}
\hline
T_1 & T_2 \\
\hline
\text{Read}(A) \rightarrow 11000 & \\
 & \text{Read}(A) \rightarrow 11000 \\
\text{Write}(A) \leftarrow 11000 - 10000 = 1000 & \\
 & \text{Write}(A) \leftarrow 11000 - 10000 = 1000 \\
\text{Write}(B) \leftarrow B + 10000 & \\
 & \text{Write}(B) \leftarrow B + 10000 \\
\hline
\end{array}
$$
 

Both transactions read the same initial value of ( A = 11000 ). Each independently computes the new balance as ( 1000 ) and writes it back. The second write overwrites the first but does not incorporate the effect of both transfers. Consequently:

  • Only one debit of ₹10,000 is reflected in ( A ) (final balance = ₹1,000),

  • Both credits are applied to ( B ) (final balance = ₹20,000).

This is a classic lost update anomaly: the update by one transaction on ( A ) is effectively lost due to the concurrent write by the other transaction.

ACID Property Violations

Consistency:
The system invariant “total money conserved” is violated:
$$[
\text{Initial total} = 11000, \quad \text{Final total} = 1000 + 20000 = 21000
]$$
$\color{red} \boxed{ \text{Violated.}}$

Isolation:
The lost update arises because transactions are not isolated; they interfere via uncoordinated reads and writes.
$\color{red} \boxed{ \text{Violated.}}$

Atomicity and Durability:
Both transactions complete all steps and persist their results; no partial execution or data loss is indicated.
$\color{lime} \boxed{ \text{Not Violated.}}$

$$
\boxed{\text{B. Consistency and C. Isolation}}
$$

6 6 votes

Correct Option: B,C (Consistency, Isolation) or Only C (Isolation)


Isolation is certain to be violated because the Isolation property states that when multiple transactions run concurrently, their effect should be equivalent to some serial schedule of those transactions. This is not the case here, since the balance of A was not deducted twice.

Atomicity and Durability are not likely to be violated.

Now, according to some Standard Books (including Korth, Navathe, etc) Consistency (of transaction) is not violated and according to other books (including ACID paper), Consistency is violated.

I asked on cs.StackExchange - https://cs.stackexchange.com/questions/173518/violation-of-only-the-acid-consistency-property-for-these-transactions/

edited by
0 0 votes

The answer is B.Consistency because in a transaction the total amount before performing the transaction should be exactly equal to amount after performing the transaction ,not less not more. but here before performing the transaction let us assume the amount in account B = 0, amount in the so called joint account (A)=11000,the total amount in both the accounts sums up to 11000 which is 11000+0. but soon after transaction the total amount is 20000(credited in acount B) + 1000(left out balance of account  A)=21000,which is not at all equal to total amount before transaction i.e 11000 which implies DB is not consistent.

Therefore the answer is "B.Consistency"

Answer:
Position:
Show:

Related questions

25 25 votes
5 5 answers
10.4k
10.4k views
admin asked Feb 27, 2025
10,441 views
Consider the database transactions T1 and T2 , and data items X and Y . Which of the schedule(s) is/are conflict serializable?$$\begin{array}{|ll|} \hline \textbf{Transa...
31 31 votes
5 5 answers
11.9k
11.9k views
admin asked Feb 27, 2025
11,949 views
Consider the following relational schema: Students ($\underline{\text{rollno: integer}},$ name: string, age: integer, cgpa: real) Courses ($\underline{\text{courseno: int...
20 20 votes
5 5 answers
9.0k
9.0k views
Arjun asked Feb 27, 2025
8,984 views
​​​​Consider the following relational schema along with all the functional dependencies that hold on them.\[\begin{array}{l}R 1(A, B, C, D, E):\{D \rightarrow E, E A \rig...
29 29 votes
6 6 answers
13.7k
13.7k views
admin asked Feb 27, 2025
13,718 views
In a $\mathrm{B}^{+}$- tree where each node can hold at most four key values, a root to leaf path consists of the following nodes:\[\mathrm{A}=(49,77,83,-), \mathrm{B}=(7...