Transaction Isolation Level - Choosing the Right

I am a beginner sql and I need help regarding transaction isolation levels. I need to know what level of isolation is best for the following situation and why:

There are 3 tables in the database:

  • Animals (which are registered by inserting a chip in them) KEY - ID_CHIP REF CHIPS
  • Chips (which may, but need not be, inserted into an animal) KEY - ID_CHIP. One of the attributes is "INSERTED_BY", which refers to the third PEOPLE table (gives the identifier of the person who inserted the chip, and NULL if it is not already inserted)
  • People - KEY: ID

Now consider the following transactions: a new chip has been added to the animal. The person who updates the database needs to change two things:

  • add a new object to the ANIMALS object
  • update the chip record that was inserted (change the INSERTED_BY attribute from NULL to the ID of the person who inserted the chip).

The second transaction is a controller transaction that checks whether the number of objects in ANIMALS is equal to the number of CHIPS for which the INSERTED_BY attribute is not NULL. The situation is shown in the figure below: Situation

Can someone tell me which of the four isolation levels is better and why? I'm stuck here. Any help would be appreciated.

+4
source share
1 answer

, - . . SNAPSHOT . .

, t2 C2.

.

SNAPSHOT SERIALIZABLE , . . , .

+1

All Articles