• Post Reply Bookmark Topic Watch Topic
  • New Topic

TRANSACTION QUESTION

 
sunilkumar ssuparasmul
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A developer is writing an Account EJB in order to provide applications access to the Account database table. The requirements are that the table rows cannot be changed when the EJB is being accessed by applications within a single transaction. Given that the transaction attribute on the bean is set to TX_REQUIRED, the BEST way to achieve this goal is to configure the Account bean with a transaction isolation level of:
a) TRANSACTION_ALLOW_READONLY.
b) TRANSACTION_SERIALIZABLE.
c) TRANSACTION_REPEATABLE_READ.
d) TRANSACTION_READ_COMMITTED.

The answer given is C.
Can anyone explain how ???
 
parag Chatterjee
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Transaction_Repeatable_read isolation level one can dirty read and repeatable reads can be avoided.Repeatable reads are what exactly mentioned in the problem.The existing will not be changed while someone is reading it.
So,this justifies the answer being C)
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer could also be b) TRANSACTION_SERIALIZABLE. This will give you the required functionality.
However, the question asks for the BEST answer to meet the criteria. Since TRANSACTION_SERIALIZABLE hinders concurrency more than TRANSACTION_REPEATABLE_READ, the best answer would be C.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!